Changeset 10797 in josm


Ignore:
Timestamp:
2016-08-13T18:19:17+02:00 (8 years ago)
Author:
Don-vip
Message:

fix #13339 - NPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Geometry.java

    r10691 r10797  
    997997                final Node node = nodes.get(i == numSegments ? 0 : i);
    998998                final EastNorth p2 = projection == null ? node.getEastNorth() : projection.latlon2eastNorth(node.getCoor());
    999                 area += p1.east() * p2.north() - p2.east() * p1.north();
    1000                 perimeter += p1.distance(p2);
     999                if (p1 != null && p2 != null) {
     1000                    area += p1.east() * p2.north() - p2.east() * p1.north();
     1001                    perimeter += p1.distance(p2);
     1002                }
    10011003                p1 = p2;
    10021004            }
Note: See TracChangeset for help on using the changeset viewer.