Index: trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java	(revision 12983)
+++ trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java	(revision 12984)
@@ -255,4 +255,7 @@
             lines.put(w, new Line(w));
         }
+        if (nodes.isEmpty()) {
+            throw new InvalidSelection(tr("Intersection of three or more ways can not be solved. Abort."));
+        }
         Collection<Command> cmds = new ArrayList<>(nodes.size());
         List<Way> referers = new ArrayList<>(ways.size());
@@ -268,6 +271,5 @@
                 cmds.add(lines.get(way).projectionCommand(n));
             } else if (referers.size() == 2) {
-                Command cmd = lines.get(referers.get(0)).intersectionCommand(n, lines.get(referers.get(1)));
-                cmds.add(cmd);
+                cmds.add(lines.get(referers.get(0)).intersectionCommand(n, lines.get(referers.get(1))));
             } else
                 throw new InvalidSelection(tr("Intersection of three or more ways can not be solved. Abort."));
