Index: /trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java	(revision 1735)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java	(revision 1736)
@@ -1093,6 +1093,6 @@
                 WayPoint R = null;
                 for (WayPoint S : seg) {
+                    EastNorth c = R.getEastNorth();
                     if (R == null) {
-                        EastNorth c = R.getEastNorth();
                         R = S;
                         rx = c.east();
@@ -1107,5 +1107,4 @@
                         }
                     } else {
-                        EastNorth c = S.getEastNorth();
                         sx = c.east();
                         sy = c.north();
