Changeset 6330 in josm


Ignore:
Timestamp:
2013-10-27T02:24:17+01:00 (11 years ago)
Author:
Don-vip
Message:

fix #9207 - Robustness in Addresses test

File:
1 edited

Legend:

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

    r6258 r6330  
    194194        for (Way streetPart : street) {
    195195            for (Pair<Node, Node> chunk : streetPart.getNodePairs(false)) {
    196                 EastNorth closest = Geometry.closestPointToSegment(
    197                         chunk.a.getEastNorth(), chunk.b.getEastNorth(), centroid);
    198                 if (closest.distance(centroid) <= maxDistance) {
    199                     return;
     196                EastNorth p1 = chunk.a.getEastNorth();
     197                EastNorth p2 = chunk.b.getEastNorth();
     198                if (p1 != null && p2 != null) {
     199                    EastNorth closest = Geometry.closestPointToSegment(p1, p2, centroid);
     200                    if (closest.distance(centroid) <= maxDistance) {
     201                        return;
     202                    }
     203                } else {
     204                    Main.warn("Addresses test skipped chunck "+chunk+" for street part "+streetPart+" because p1 or p2 is null");
    200205                }
    201206            }
Note: See TracChangeset for help on using the changeset viewer.