Index: /trunk/src/org/openstreetmap/josm/tools/Geometry.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 7071)
+++ /trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 7072)
@@ -701,5 +701,5 @@
             EastNorth n1 = nodes.get((i+1) % nodes.size()).getEastNorth();
 
-            if (n0.isValid() && n1.isValid()) {
+            if (n0 != null && n1 != null && n0.isValid() && n1.isValid()) {
                 BigDecimal x0 = new BigDecimal(n0.east());
                 BigDecimal y0 = new BigDecimal(n0.north());
@@ -727,5 +727,5 @@
     /**
      * Compute center of the circle closest to different nodes.
-     * 
+     *
      * Ensure exact center computation in case nodes are already aligned in circle.
      * This is done by least square method.
@@ -788,5 +788,5 @@
         return new EastNorth(xC, yC);
     }
-    
+
     /**
      * Returns the coordinate of intersection of segment sp1-sp2 and an altitude
