Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ErrorLayer.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ErrorLayer.java	(revision 17173)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ErrorLayer.java	(revision 17174)
@@ -20,4 +20,5 @@
 import org.openstreetmap.josm.gui.dialogs.LayerListPopup;
 import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.layer.Layer.LayerChangeListener;
 import org.openstreetmap.josm.plugins.validator.util.Bag;
@@ -133,5 +134,6 @@
      */
     public void layerRemoved(Layer oldLayer) {
-        if (oldLayer == Main.map.mapView.getEditLayer()) {
+        if (oldLayer instanceof OsmDataLayer &&  Main.map.mapView.getEditLayer() == null) {
+            System.out.println("inside removeLayer");
             Main.map.mapView.removeLayer(this);
         } else if (oldLayer == this) {
