From 42407f6b97daaec5e3e2f9404112079bdc3425ee Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Tue, 4 Mar 2008 17:27:05 +0000 Subject: [PATCH] * Fixes NB#81719, modest_tny_account_get_server_account could return NULL, so now we check that * This fix does not fix the root cause of the bug because it was previously fixed by some other commits (the bug could not be reproduced with the current HEAD) pmo-trunk-r4272 --- src/modest-mail-operation.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index 44fdc7a..51bbb8a 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -1518,6 +1518,24 @@ modest_mail_operation_update_account (ModestMailOperation *self, account_name, TNY_ACCOUNT_TYPE_STORE); + /* The above function could return NULL */ + if (!priv->account) { + /* Check if the operation was a success */ + g_set_error (&(priv->error), MODEST_MAIL_OPERATION_ERROR, + MODEST_MAIL_OPERATION_ERROR_ITEM_NOT_FOUND, + "no account"); + priv->status = MODEST_MAIL_OPERATION_STATUS_FAILED; + + /* Call the user callback */ + if (callback) + callback (self, NULL, user_data); + + /* Notify about operation end */ + modest_mail_operation_notify_end (self); + + return; + } + /* Create the helper object */ info = g_slice_new0 (UpdateAccountInfo); info->pending_calls = 1; -- 1.7.9.5