Index: /trunk/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java	(revision 5906)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java	(revision 5907)
@@ -156,5 +156,5 @@
     @Override
     public void layerRemoved(Layer oldLayer) {
-        if (oldLayer instanceof OsmDataLayer &&  Main.map.mapView.getEditLayer() == null) {
+        if (oldLayer instanceof OsmDataLayer && Main.map != null && Main.map.mapView.getEditLayer() == null) {
             Main.main.removeLayer(this);
         } else if (oldLayer == this) {
