From: José Dapena Paz Date: Mon, 15 Feb 2010 16:45:51 +0000 (+0100) Subject: Avoid a crash on requesting to open a msg view that window mgr rejects. X-Git-Tag: 3.2.13-1~8 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=f7b838795d57791e623ea279d8971d07864bcbf9 Avoid a crash on requesting to open a msg view that window mgr rejects. --- diff --git a/src/hildon2/modest-msg-view-window.c b/src/hildon2/modest-msg-view-window.c index f3ff4f0..cf2f3f3 100644 --- a/src/hildon2/modest-msg-view-window.c +++ b/src/hildon2/modest-msg-view-window.c @@ -2209,10 +2209,10 @@ view_msg_cb (ModestMailOperation *mail_op, modest_window_mgr_unregister_header (modest_runtime_get_window_mgr (), header); row_reference = (GtkTreeRowReference *) user_data; - if (canceled) { + self = (ModestMsgViewWindow *) modest_mail_operation_get_source (mail_op); + if (canceled || !self || MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (self)->msg_view == NULL ) { if (row_reference) gtk_tree_row_reference_free (row_reference); - self = (ModestMsgViewWindow *) modest_mail_operation_get_source (mail_op); if (self) { /* Restore window title */ update_window_title (self); @@ -2226,7 +2226,6 @@ view_msg_cb (ModestMailOperation *mail_op, if (!modest_ui_actions_msg_retrieval_check (mail_op, header, msg)) { if (row_reference) gtk_tree_row_reference_free (row_reference); - self = (ModestMsgViewWindow *) modest_mail_operation_get_source (mail_op); if (self) { priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (self); /* First we check if the parent is a folder window */ @@ -2290,7 +2289,6 @@ view_msg_cb (ModestMailOperation *mail_op, } /* Get the window */ - self = (ModestMsgViewWindow *) modest_mail_operation_get_source (mail_op); g_return_if_fail (MODEST_IS_MSG_VIEW_WINDOW (self)); priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (self);