Index: /applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbLayer.java
===================================================================
--- /applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbLayer.java	(revision 14816)
+++ /applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbLayer.java	(revision 14817)
@@ -78,5 +78,9 @@
         });
 
-        Main.map.mapView.addMouseListener(this);
+        // if the map layer has been closed, while we are requesting the osb db,
+        // the mapframe is null, so we check that, before installing the mouse listener
+        if(Main.map != null && Main.map.mapView != null) { 
+            Main.map.mapView.addMouseListener(this);
+        }
     }
 
Index: /applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbPlugin.java
===================================================================
--- /applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbPlugin.java	(revision 14816)
+++ /applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbPlugin.java	(revision 14817)
@@ -152,5 +152,10 @@
             // display the parsed data
             if(!dataSet.nodes.isEmpty()) {
-                updateGui();
+                // if the map layer has been closed, while we are requesting the osb db,
+                // we don't have to update the gui, because the user is not interested
+                // in this area anymore
+                if(Main.map != null && Main.map.mapView != null) {
+                    updateGui();
+                }
             }
         } catch (Exception e) {
