Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 6060)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 6061)
@@ -96,5 +96,5 @@
 
     /** The action to toggle this dialog */
-    protected ToggleDialogAction toggleAction;
+    protected final ToggleDialogAction toggleAction;
     protected String preferencePrefix;
     final protected String name;
@@ -242,5 +242,7 @@
             if (isShowing) {
                 hideDialog();
-                dialogsPanel.reconstruct(Action.ELEMENT_SHRINKS, null);
+                if (dialogsPanel != null) {
+                    dialogsPanel.reconstruct(Action.ELEMENT_SHRINKS, null);
+                }
                 hideNotify();
             } else {
@@ -249,5 +251,5 @@
                     expand();
                 }
-                if (isDocked) {
+                if (isDocked && dialogsPanel != null) {
                     dialogsPanel.reconstruct(Action.INVISIBLE_TO_DEFAULT, ToggleDialog.this);
                 }
