From 81331f39c01b210eec6bd8e597cb4697530ae70b Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Tue, 5 Feb 2008 08:20:42 +0000 Subject: [PATCH] * 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 --- src/modest-mail-operation.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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); -- 1.7.9.5