X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-window-mgr.c;h=a4153be956ebcde4935bf204f4811643c899985b;hp=f6990de4024c5e98e3932fb039350a66b9cb6727;hb=1bd27461f6e6817bda252cebb93fb1360e47cb9b;hpb=76f7149cbfe9f5e94a7db4870df3294bae107187;ds=sidebyside 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 */