diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/commands/MergeDuplicateWays.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/commands/MergeDuplicateWays.java index 6ce1a6f..fb42cb8 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/commands/MergeDuplicateWays.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/commands/MergeDuplicateWays.java @@ -66,6 +66,8 @@ public class MergeDuplicateWays extends Command { filterDataSet(getAffectedDataSet(), commands); } else if (way1 != null && way2 == null) { checkForDuplicateWays(way1, commands); + } else if (way1 == null) { + checkForDuplicateWays(way2, commands); } else { Command command = checkForDuplicateWays(way1, way2); if (command != null) { @@ -302,7 +304,7 @@ public class MergeDuplicateWays extends Command { final Node possDupeNode = way2.getNode(k); if (origNode.equals(possDupeNode) || origNode.getCoor().greatCircleDistance(possDupeNode.getCoor()) < MapWithAIPreferenceHelper - .getMaxNodeDistance()) { + .getMaxNodeDistance()) { final Pair origNodePair = new Pair<>(j, origNode); final Map dupeNodeMap = duplicateNodes.getOrDefault(origNodePair, new HashMap<>()); dupeNodeMap.put(k, possDupeNode);