Changeset 19943 in osm for applications/editors/josm


Ignore:
Timestamp:
2010-02-09T17:05:25+01:00 (15 years ago)
Author:
rcernoch
Message:

CzechAddress: Plugin no longer crashes if a Way contains 0 nodes (which now happens during deletion).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/AddressElement.java

    r17603 r19943  
    9696        }
    9797
    98         if (prim instanceof Node)
    99             result += " " + StringUtils.latLonToString(((Node) prim).getCoor());
    100         else if (prim instanceof Way)
    101             result += " " + StringUtils.latLonToString(((Way) prim).firstNode().getCoor());
     98        if (prim instanceof Node) {
     99            Node node = (Node) prim;
     100            result += " " + StringUtils.latLonToString(node.getCoor());
     101           
     102        } else if (prim instanceof Way) {
     103            Way way = (Way) prim;
     104            if (way.getNodesCount() > 0)
     105                result += " " + StringUtils.latLonToString(way.firstNode().getCoor());
     106            else
     107                result += " empty way";
     108        }
    102109
    103110        if (prim.isDeleted())
Note: See TracChangeset for help on using the changeset viewer.