Index: applications/editors/josm/plugins/piclayer/build.xml
===================================================================
--- applications/editors/josm/plugins/piclayer/build.xml	(revision 29598)
+++ applications/editors/josm/plugins/piclayer/build.xml	(revision 29601)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <project name="PicLayer" default="dist" basedir=".">
-    <property name="commit.message" value="PicLayer - #7127 - added world file loading option"/>
+    <property name="commit.message" value="PicLayer - #8743 - fixed NPE when removing last layer"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
     <property name="plugin.main.version" value="5960"/>
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java	(revision 29598)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java	(revision 29601)
@@ -169,5 +169,6 @@
                 new SavePictureCalibrationAction((PicLayerAbstract) arg0).actionPerformed(null);
         }
-        boolean enable = Main.map.mapView.getAllLayers().size() != 0;
+        // Why should I do all these checks now?
+        boolean enable = Main.map != null && Main.map.mapView != null && Main.map.mapView.getAllLayers() != null && Main.map.mapView.getAllLayers().size() != 0;
         menu.setEnabled(enable);
     }
