Ticket #11630: 0004-Workaround-for-NPE-in-ImproveWayAccuracyHelper.java.patch

File 0004-Workaround-for-NPE-in-ImproveWayAccuracyHelper.java.patch, 1.1 KB (added by michael2402, 9 years ago)
  • src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyHelper.java

    From f47befb512eb70459e4707221a3a2b48f3bdeac2 Mon Sep 17 00:00:00 2001
    From: Michael Zangl <michael.zangl@student.kit.edu>
    Date: Wed, 1 Jul 2015 14:23:03 +0200
    Subject: [PATCH 4/8] Workaround for NPE in ImproveWayAccuracyHelper.java
    
    ---
     .../openstreetmap/josm/actions/mapmode/ImproveWayAccuracyHelper.java  | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyHelper.java b/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyHelper.java
    index bacf73e..a0958c8 100644
    a b final class ImproveWayAccuracyHelper {  
    8585        mainLoop:
    8686        for (Node n : w.getNodes()) {
    8787            EastNorth nEN = n.getEastNorth();
     88            if (nEN == null) {
     89                // Might happen if lat/lon for that point are not known.
     90                continue;
     91            }
    8892            currentDistance = pEN.distance(nEN);
    8993
    9094            if (currentDistance < bestDistance) {