Index: trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java	(revision 5075)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java	(revision 5076)
@@ -147,10 +147,10 @@
             c = DeleteCommand.delete(getEditLayer(),getCurrentDataSet().getSelected(), !alt /* also delete nodes in way */);
         }
+        // if c is null, an error occurred or the user aborted. Don't do anything in that case.
         if (c != null) {
             Main.main.undoRedo.add(c);
-        }
-
-        getCurrentDataSet().setSelected();
-        Main.map.repaint();
+            getCurrentDataSet().setSelected();
+            Main.map.repaint();
+        }
     }
 
