Index: trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java	(revision 4582)
+++ trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java	(revision 4583)
@@ -129,5 +129,5 @@
         // remove all history browsers if the number of layers drops to 0
         //
-        if (Main.map.mapView.getNumLayers() == 0) {
+        if (Main.map != null && Main.map.mapView.getNumLayers() == 0) {
             hideAll();
         }
