* fix for a rare crash; fixes NB#80616.
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Wed, 13 Feb 2008 20:02:12 +0000 (20:02 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Wed, 13 Feb 2008 20:02:12 +0000 (20:02 +0000)
it's debatable whether this bug was not  already fixed by the send-queue fixes done before; but as this crash was seen with W06, there *might* still be a problem.
so, fixing the symptom here. not sure what led to the crash, but it should not happen anymore.

pmo-trunk-r4173

src/modest-tny-account-store.c

index 5e9bb8d..6fbc996 100644 (file)
@@ -1348,8 +1348,8 @@ modest_tny_account_store_get_server_account (ModestTnyAccountStore *self,
 }
 
 TnyAccount*
-modest_tny_account_store_get_smtp_specific_transport_account_for_open_connection (ModestTnyAccountStore *self,
-                                                                                 const gchar *account_name)
+modest_tny_account_store_get_smtp_specific_transport_account_for_open_connection (
+       ModestTnyAccountStore *self, const gchar *account_name)
 {
        TnyDevice *device;
 
@@ -1358,7 +1358,12 @@ modest_tny_account_store_get_smtp_specific_transport_account_for_open_connection
 
        /* Get the current connection: */
        device = modest_runtime_get_device ();
-       
+
+       if (!device) {
+               g_warning ("%s: could not get device", __FUNCTION__);
+               return NULL;
+       }
+               
        if (!tny_device_is_online (device))
                return NULL;