Index: /trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 5946)
+++ /trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 5947)
@@ -507,6 +507,9 @@
         // Delete the discarded inner ways
         if (discardedWays.size() > 0) {
-            cmds.add(DeleteCommand.delete(Main.map.mapView.getEditLayer(), discardedWays, true));
-            commitCommands(marktr("Delete Ways that are not part of an inner multipolygon"));
+            Command deleteCmd = DeleteCommand.delete(Main.map.mapView.getEditLayer(), discardedWays, true);
+            if (deleteCmd != null) {
+                cmds.add(deleteCmd);
+                commitCommands(marktr("Delete Ways that are not part of an inner multipolygon"));
+            }
         }
 
Index: /trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java	(revision 5946)
+++ /trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java	(revision 5947)
@@ -469,5 +469,7 @@
                     nodeList.add(candidateNode);
                     Command deleteCmd = DeleteCommand.delete(getEditLayer(), nodeList, true);
-                    Main.main.undoRedo.add(deleteCmd);
+                    if (deleteCmd != null) {
+                        Main.main.undoRedo.add(deleteCmd);
+                    }
                 }
 
