Index: trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java	(revision 1820)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java	(revision 1821)
@@ -53,4 +53,6 @@
     @Override public void enterMode() {
         super.enterMode();
+        if (!isEnabled())
+            return;
         Main.map.mapView.addMouseListener(this);
     }
@@ -135,3 +137,8 @@
         return l instanceof OsmDataLayer;
     }
+
+    @Override
+    protected void updateEnabledState() {
+        setEnabled(Main.map != null && Main.map.mapView != null && Main.map.mapView.isActiveLayerDrawable());
+    }
 }
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 1820)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 1821)
@@ -204,4 +204,6 @@
 
     @Override public void enterMode() {
+        if (!isEnabled())
+            return;
         super.enterMode();
         currCursor = Cursors.crosshair;
@@ -929,5 +931,5 @@
          * Handle special case: Highlighted node == selected node => finish drawing
          */
-        if (n != null && getCurrentDataSet().getSelectedNodes().contains(n)) {
+        if (n != null && getCurrentDataSet() != null && getCurrentDataSet().getSelectedNodes().contains(n)) {
             if (wayIsFinished) {
                 rv = tr("Select node under cursor.");
@@ -940,5 +942,5 @@
          * Handle special case: Self-Overlapping or closing way
          */
-        if (getCurrentDataSet().getSelectedWays().size() > 0 && !wayIsFinished && !alt) {
+        if (getCurrentDataSet() != null && getCurrentDataSet().getSelectedWays().size() > 0 && !wayIsFinished && !alt) {
             Way w = (Way) getCurrentDataSet().getSelectedWays().iterator().next();
             for (Node m : w.nodes) {
@@ -955,3 +957,8 @@
         return l instanceof OsmDataLayer;
     }
+
+    @Override
+    protected void updateEnabledState() {
+        setEnabled(getEditLayer() != null);
+    }
 }
