Changeset 1611 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2009-05-23T12:03:21+02:00 (15 years ago)
Author:
stoecker
Message:

fix #2578 - exception on zero length ways

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/Way.java

    r1598 r1611  
    175175
    176176    public Node lastNode() {
    177         if (incomplete) return null;
     177        if (incomplete || nodes.size() == 0) return null;
    178178        return nodes.get(nodes.size()-1);
    179179    }
    180180
    181181    public Node firstNode() {
    182         if (incomplete) return null;
     182        if (incomplete || nodes.size() == 0) return null;
    183183        return nodes.get(0);
    184184    }
    185185
    186186    public boolean isFirstLastNode(Node n) {
    187         if (incomplete) return false;
     187        if (incomplete || nodes.size() == 0) return false;
    188188        return n == firstNode() || n == lastNode();
    189189    }
Note: See TracChangeset for help on using the changeset viewer.