From: Sergio Villar Senin Date: Wed, 18 Mar 2009 17:13:44 +0000 (+0000) Subject: Fixes FwNULL 6/16 & 7/16 & 8/16 X-Git-Tag: git_migration_finished~263 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=a928ea9cd483356e9bbb31a11609a380b5954f94 Fixes FwNULL 6/16 & 7/16 & 8/16 pmo-trunk-r8173 --- diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index f1907d5..79d9c47 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -1232,16 +1232,18 @@ modest_mail_operation_save_to_drafts_cb (ModestMailOperation *self, } if (!priv->error || priv->error->code == MODEST_MAIL_OPERATION_ERROR_FILE_IO) { - SaveToDraftsAddMsgInfo *cb_info = g_slice_new(SaveToDraftsAddMsgInfo); - cb_info->transport_account = g_object_ref(info->transport_account); - cb_info->draft_msg = info->draft_msg ? g_object_ref(info->draft_msg) : NULL; - cb_info->callback = info->callback; - cb_info->user_data = info->user_data; - cb_info->drafts = g_object_ref(drafts); - cb_info->msg = g_object_ref(msg); - cb_info->mailop = g_object_ref(self); - tny_folder_add_msg_async(drafts, msg, modest_mail_operation_save_to_drafts_add_msg_cb, - NULL, cb_info); + if (drafts) { + SaveToDraftsAddMsgInfo *cb_info = g_slice_new(SaveToDraftsAddMsgInfo); + cb_info->transport_account = g_object_ref(info->transport_account); + cb_info->draft_msg = info->draft_msg ? g_object_ref(info->draft_msg) : NULL; + cb_info->callback = info->callback; + cb_info->user_data = info->user_data; + cb_info->drafts = g_object_ref(drafts); + cb_info->msg = g_object_ref(msg); + cb_info->mailop = g_object_ref(self); + tny_folder_add_msg_async(drafts, msg, modest_mail_operation_save_to_drafts_add_msg_cb, + NULL, cb_info); + } } else { /* Call the user callback */ priv->status = MODEST_MAIL_OPERATION_STATUS_FAILED;