From 1bd27461f6e6817bda252cebb93fb1360e47cb9b Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Tue, 23 Oct 2007 11:06:16 +0000 Subject: [PATCH] * The viewer handler could not exist if the viewer window was created without a main window present (for example when opening a message through D-Bus) pmo-trunk-r3560 --- src/widgets/modest-window-mgr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/widgets/modest-window-mgr.c b/src/widgets/modest-window-mgr.c index f6990de..a4153be 100644 --- a/src/widgets/modest-window-mgr.c +++ b/src/widgets/modest-window-mgr.c @@ -670,9 +670,13 @@ modest_window_mgr_unregister_window (ModestWindowMgr *self, HashTable could not exist if the main window was closeed when there were other windows remaining */ if (MODEST_IS_MSG_VIEW_WINDOW (window) && priv->viewer_handlers) { - tmp = (gulong *) g_hash_table_lookup (priv->viewer_handlers, window); - g_signal_handler_disconnect (window, *tmp); - g_hash_table_remove (priv->viewer_handlers, window); + /* If the viewer was created without a main window + (for example when opening a message through D-Bus + the viewer handlers was not registered */ + if (tmp) { + g_signal_handler_disconnect (window, *tmp); + g_hash_table_remove (priv->viewer_handlers, window); + } } /* Save state */ -- 1.7.9.5