From f7b838795d57791e623ea279d8971d07864bcbf9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Dapena=20Paz?= Date: Mon, 15 Feb 2010 17:45:51 +0100 Subject: [PATCH] Avoid a crash on requesting to open a msg view that window mgr rejects. --- src/hildon2/modest-msg-view-window.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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); -- 1.7.9.5