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));
}
}
*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;