Ticket #3804: join-node-way-fix.patch

File join-node-way-fix.patch, 1.1 KB (added by Daeron, 16 years ago)
  • src/org/openstreetmap/josm/actions/JoinNodeWayAction.java

     
    5959
    6060        Collection<Command> cmds = new LinkedList<Command>();
    6161        for (Map.Entry<Way, List<Integer>> insertPoint : insertPoints.entrySet()) {
     62            List<Integer> is = insertPoint.getValue();
     63            if (is.size() == 0)
     64                continue;
     65
    6266            Way w = insertPoint.getKey();
    6367            List<Node> nodesToAdd = w.getNodes();
    64             List<Integer> is = insertPoint.getValue();
    6568            pruneSuccsAndReverse(is);
    6669            for (int i : is) {
    6770                nodesToAdd.add(i+1, node);
     
    7174            cmds.add(new ChangeCommand(w, wnew));
    7275        }
    7376
     77        if (cmds.size() == 0)
     78            return;
     79
    7480        Main.main.undoRedo.add(new SequenceCommand(tr("Join Node and Line"), cmds));
    7581        Main.map.repaint();
    7682    }