X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-mail-operation.c;h=51bbb8a42406227ba34a6af5f3bb23daa0051154;hp=44fdc7a037bf9ccee39dafa750c7009534f75bee;hb=42407f6b97daaec5e3e2f9404112079bdc3425ee;hpb=f02807b9ef9bdaa0291310798541fefadbb13227 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;