Changeset 6400 in josm for trunk/src


Ignore:
Timestamp:
2013-11-22T22:15:16+01:00 (11 years ago)
Author:
simon04
Message:

fix #7465 - NullPointerException in WayConnectedToArea due to Way w/ 0 nodes

Location:
trunk/src/org/openstreetmap/josm/data/validation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/Test.java

    r6354 r6400  
    154154        progressMonitor.setTicksCount(selection.size());
    155155        for (OsmPrimitive p : selection) {
    156             if (p.isUsable()) {
     156            if (isPrimitiveUsable(p)) {
    157157                p.accept(this);
    158158            }
    159159            progressMonitor.worked(1);
    160160        }
     161    }
     162
     163    public boolean isPrimitiveUsable(OsmPrimitive p) {
     164        return p.isUsable() && (!(p instanceof Way) || (((Way) p).getNodesCount() > 1)); // test only Ways with at least 2 nodes
    161165    }
    162166
  • trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java

    r6240 r6400  
    153153        return deletePrimitivesIfNeeded(testError.getPrimitives());
    154154    }
     155
     156    @Override
     157    public boolean isPrimitiveUsable(OsmPrimitive p) {
     158        return p.isUsable();
     159    }
    155160}
Note: See TracChangeset for help on using the changeset viewer.