Index: trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 5652)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 5653)
@@ -674,4 +674,5 @@
         Command c = getLastCommand();
         if (mode == Mode.move) {
+            if (startEN == null) return false; // fix #8128
             getCurrentDataSet().beginUpdate();
             if (c instanceof MoveCommand && affectedNodes.equals(((MoveCommand) c).getParticipatingPrimitives())) {
@@ -686,4 +687,5 @@
                     // Revert move
                     ((MoveCommand) c).resetToCheckpoint();
+                    getCurrentDataSet().endUpdate();
                     JOptionPane.showMessageDialog(
                             Main.parent,
@@ -695,27 +697,26 @@
                 }
             }
-            getCurrentDataSet().endUpdate();
-            return true;
-        } 
-
-        startEN = currentEN; // drag can continue after scaling/rotation
-
-        if (mode == Mode.rotate) {
-            getCurrentDataSet().beginUpdate();
-            if (c instanceof RotateCommand && affectedNodes.equals(((RotateCommand) c).getTransformedNodes())) {
-                ((RotateCommand) c).handleEvent(currentEN);
+        } else {
+            startEN = currentEN; // drag can continue after scaling/rotation
+    
+            if (mode == Mode.rotate) {
+                getCurrentDataSet().beginUpdate();
+                if (c instanceof RotateCommand && affectedNodes.equals(((RotateCommand) c).getTransformedNodes())) {
+                    ((RotateCommand) c).handleEvent(currentEN);
+                } else {
+                    Main.main.undoRedo.add(new RotateCommand(selection, currentEN));
+                }
+            } else if (mode == Mode.scale) {
+                getCurrentDataSet().beginUpdate();
+                if (c instanceof ScaleCommand && affectedNodes.equals(((ScaleCommand) c).getTransformedNodes())) {
+                    ((ScaleCommand) c).handleEvent(currentEN);
+                } else {
+                    Main.main.undoRedo.add(new ScaleCommand(selection, currentEN));
+                }
             } else {
-                Main.main.undoRedo.add(new RotateCommand(selection, currentEN));
-            }
-            getCurrentDataSet().endUpdate();
-        } else if (mode == Mode.scale) {
-            getCurrentDataSet().beginUpdate();
-            if (c instanceof ScaleCommand && affectedNodes.equals(((ScaleCommand) c).getTransformedNodes())) {
-                ((ScaleCommand) c).handleEvent(currentEN);
-            } else {
-                Main.main.undoRedo.add(new ScaleCommand(selection, currentEN));
-            }
-            getCurrentDataSet().endUpdate();
-        }
+                return false;
+            }
+        }
+        getCurrentDataSet().endUpdate();
         return true;
     }
