Index: trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java	(revision 367)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java	(revision 368)
@@ -102,8 +102,8 @@
 		
 		OsmPrimitive sel = Main.map.mapView.getNearestNode(e.getPoint());
-		Command c;
+		Command c = null;
 		if (sel == null) {
 			WaySegment ws = Main.map.mapView.getNearestWaySegment(e.getPoint());
-			c = deleteWaySegment(ws);
+			if (ws != null) c = deleteWaySegment(ws);
 		} else if (ctrl) {
 			c = deleteWithReferences(Collections.singleton(sel));
