diff --git a/fsl/fslview/fslviewframe.py b/fsl/fslview/fslviewframe.py
index 06bd9d252043855e5509218f48a40c3d04e25dc1..bb7ab3f30c28f39b0f73ccbadf879eaa2913a550 100644
--- a/fsl/fslview/fslviewframe.py
+++ b/fsl/fslview/fslviewframe.py
@@ -170,6 +170,14 @@ class FSLViewFrame(wx.Frame):
 
         def onViewPanelDestroy(ev):
             ev.Skip()
+
+            # if the config panel has already been closed, it
+            # will have been replaced with a python wrapper
+            # around a deleted C++ object. When converted to
+            # boolean, this wrapper will evaluate to False.
+            if not confPanel:
+                return
+            
             self._auimgr.DetachPane(confPanel)
             self._auimgr.Update()
             confPanel.Destroy()