From: Sergio Villar Senin Date: Fri, 23 Jan 2009 10:05:50 +0000 (+0000) Subject: * Fixes a potential crash when deleting accounts X-Git-Tag: git_migration_finished~736 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=2c6e266a8b3d42e3054735b7ff5a79b80bf99127 * Fixes a potential crash when deleting accounts pmo-trunk-r7254 --- diff --git a/src/hildon2/modest-msg-view-window.c b/src/hildon2/modest-msg-view-window.c index 315f3c8..226d5b5 100644 --- a/src/hildon2/modest-msg-view-window.c +++ b/src/hildon2/modest-msg-view-window.c @@ -2280,7 +2280,7 @@ on_account_removed (TnyAccountStore *account_store, parent_acc = modest_tny_account_get_parent_modest_account_name_for_server_account (account); /* Close this window if I'm showing a message of the removed account */ - if (strcmp (parent_acc, our_acc) == 0) + if (our_acc && parent_acc && strcmp (parent_acc, our_acc) == 0) modest_ui_actions_on_close_window (NULL, MODEST_WINDOW (user_data)); } } diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 0b00320..523435a 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -1007,6 +1007,15 @@ get_info_from_header (TnyHeader *header, gboolean *is_draft, gboolean *can_open) *is_draft = TRUE; /* Open in editor if the message is in the Drafts folder */ } + if (!account) { + TnyAccount *acc = tny_folder_get_account (folder); + if (acc) { + account = + g_strdup (modest_tny_account_get_parent_modest_account_name_for_server_account (acc)); + g_object_unref (acc); + } + } + g_object_unref (folder); return account;