From: Dirk-Jan C. Binnema Date: Tue, 5 Feb 2008 08:20:42 +0000 (+0000) Subject: * if called at the wrong time, tny_send_queue_get_outbox may return NULL; X-Git-Tag: git_migration_finished~1716 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=81331f39c01b210eec6bd8e597cb4697530ae70b * if called at the wrong time, tny_send_queue_get_outbox may return NULL; check for this, fixes a crash (NB#80225) pmo-trunk-r4136 --- diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index 7baff77..7b80ce3 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -1353,9 +1353,14 @@ inbox_refreshed_cb (TnyFolder *inbox, /* Get outbox folder */ outbox = tny_send_queue_get_outbox (TNY_SEND_QUEUE (send_queue)); - num_messages = tny_folder_get_all_count (outbox); - g_object_unref (outbox); - + if (outbox) { /* this could fail in some cases */ + num_messages = tny_folder_get_all_count (outbox); + g_object_unref (outbox); + } else { + g_warning ("%s: could not get outbox", __FUNCTION__); + num_messages = 0; + } + if (num_messages != 0) { /* Send mails */ g_object_unref (priv->account);