--- gedit-2.16.1/gedit/gedit-window.c.orig	2006-10-23 10:07:47.070900000 +0900
+++ gedit-2.16.1/gedit/gedit-window.c	2006-10-23 10:16:44.728572000 +0900
@@ -182,6 +182,7 @@ gedit_window_destroy (GtkObject *object)
 	if (gedit_prefs_manager_window_state_can_set ())
 		gedit_prefs_manager_set_window_state (window->priv->window_state);
 
+	if (GEDIT_IS_PANEL (window->priv->side_panel)) {
 	if ((window->priv->side_panel_size > 0) &&
 	    gedit_prefs_manager_side_panel_size_can_set ())
 		gedit_prefs_manager_set_side_panel_size	(
@@ -191,7 +192,9 @@ gedit_window_destroy (GtkObject *object)
 	if (pane_page != 0 &&
 	    gedit_prefs_manager_side_panel_active_page_can_set ())
 		gedit_prefs_manager_set_side_panel_active_page (pane_page);
+	}
 
+	if (GEDIT_IS_PANEL (window->priv->bottom_panel)) {
 	if ((window->priv->bottom_panel_size > 0) && 
 	    gedit_prefs_manager_bottom_panel_size_can_set ())
 		gedit_prefs_manager_set_bottom_panel_size (
@@ -201,6 +204,7 @@ gedit_window_destroy (GtkObject *object)
 	if (pane_page != 0 &&
 	    gedit_prefs_manager_bottom_panel_active_page_can_set ())
 		gedit_prefs_manager_set_bottom_panel_active_page (pane_page);
+	}
 
 	GTK_OBJECT_CLASS (gedit_window_parent_class)->destroy (object);
 }
