Ignore:
Timestamp:
2013-09-04T00:37:59+02:00 (12 years ago)
Author:
Don-vip
Message:

fix #9042 - Robustness to invalid .osm files containing null coordinates

File:
1 edited

Legend:

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

    r6173 r6215  
    151151        for (Node n : nodes) {
    152152            OldNodeState os = it.next();
    153             n.setEastNorth(os.eastNorth.add(x, y));
     153            if (os.eastNorth != null) {
     154                n.setEastNorth(os.eastNorth.add(x, y));
     155            }
    154156        }
    155157    }
     
    160162            if (n == null)
    161163                throw new AssertionError("null detected in node list");
    162             if (n.getEastNorth() == null)
    163                 throw new AssertionError("null coordinates detected in node list");
    164 
    165             n.setEastNorth(n.getEastNorth().add(x, y));
    166             n.setModified(true);
     164            EastNorth en = n.getEastNorth();
     165            if (en != null) {
     166                n.setEastNorth(en.add(x, y));
     167                n.setModified(true);
     168            }
    167169        }
    168170        return true;
Note: See TracChangeset for help on using the changeset viewer.