Changeset 12984 in josm


Ignore:
Timestamp:
2017-10-11T20:11:36+02:00 (2 months ago)
Author:
Don-vip
Message:

fix #15429 - add robustness to AlignInLineAction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java

    r12641 r12984  
    255255            lines.put(w, new Line(w));
    256256        }
     257        if (nodes.isEmpty()) {
     258            throw new InvalidSelection(tr("Intersection of three or more ways can not be solved. Abort."));
     259        }
    257260        Collection<Command> cmds = new ArrayList<>(nodes.size());
    258261        List<Way> referers = new ArrayList<>(ways.size());
     
    268271                cmds.add(lines.get(way).projectionCommand(n));
    269272            } else if (referers.size() == 2) {
    270                 Command cmd = lines.get(referers.get(0)).intersectionCommand(n, lines.get(referers.get(1)));
    271                 cmds.add(cmd);
     273                cmds.add(lines.get(referers.get(0)).intersectionCommand(n, lines.get(referers.get(1))));
    272274            } else
    273275                throw new InvalidSelection(tr("Intersection of three or more ways can not be solved. Abort."));
Note: See TracChangeset for help on using the changeset viewer.