Ignore:
Timestamp:
2013-04-03T22:34:42+02:00 (12 years ago)
Author:
Don-vip
Message:

fix #8567 - fix NPE when checking if incomplete nodes to delete are outside the downloaded area

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/Command.java

    r5759 r5824  
    1616
    1717import org.openstreetmap.josm.Main;
     18import org.openstreetmap.josm.data.coor.LatLon;
    1819import org.openstreetmap.josm.data.osm.Node;
    1920import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    217218
    218219    private static boolean isOutlying(OsmPrimitive osm, Area area) {
    219         if (osm instanceof Node) {
    220             return !osm.isNewOrUndeleted() && !area.contains(((Node) osm).getCoor());
     220        if (osm instanceof Node && !osm.isNewOrUndeleted()) {
     221            LatLon coor = ((Node) osm).getCoor();
     222            return coor != null && !area.contains(coor);
    221223        } else if (osm instanceof Way) {
    222224            for (Node n : ((Way) osm).getNodes()) {
Note: See TracChangeset for help on using the changeset viewer.