2007-07-24 Murray Cumming <murrayc@murrayc.com>
authorMurray Cumming <murrayc@murrayc.com>
Tue, 24 Jul 2007 16:54:32 +0000 (16:54 +0000)
committerMurray Cumming <murrayc@murrayc.com>
Tue, 24 Jul 2007 16:54:32 +0000 (16:54 +0000)
* src/maemo/modest-maemo-global-settings-dialog.c:
(current_connection):
Avoid a crash (probably only in scratchbox) when strcmp()ing a
NULL when closing the dialog.

pmo-trunk-r2787

ChangeLog2
src/dbus_api/modest-dbus-callbacks.c
src/maemo/modest-maemo-global-settings-dialog.c

index f1f59b0..054e8cd 100644 (file)
@@ -1,5 +1,12 @@
 2007-07-24  Murray Cumming  <murrayc@murrayc.com>
 
+       * src/maemo/modest-maemo-global-settings-dialog.c:
+       (current_connection):
+       Avoid a crash (probably only in scratchbox) when strcmp()ing a 
+       NULL when closing the dialog.
+
+2007-07-24  Murray Cumming  <murrayc@murrayc.com>
+
        * src/dbus_api/modest-dbus-callbacks.c: (on_idle_delete_message):
        Remove the hacky send/receive that didn't work, and instead 
        refilter the treemodel to make the deleted email really vanish from 
index c0cfc11..2f39ffb 100644 (file)
@@ -816,6 +816,7 @@ on_idle_send_receive(gpointer user_data)
 
 static gint on_send_receive(GArray * arguments, gpointer data, osso_rpc_t * retval)
 {      
+       printf("DEBUG: modest: %s\n", __FUNCTION__);
     /* Use g_idle to context-switch into the application's thread: */
 
     /* This method has no arguments. */
index 1857c72..b44f141 100644 (file)
@@ -478,8 +478,8 @@ on_range_error (HildonNumberEditor *editor,
 static ModestConnectedVia
 current_connection (void)
 {
-       TnyAccountStore *account_store;
-       TnyDevice *device;
+       TnyAccountStore *account_store = NULL;
+       TnyDevice *device = NULL;
        ModestConnectedVia retval = MODEST_CONNECTED_VIA_ANY;
        
        account_store = TNY_ACCOUNT_STORE (modest_runtime_get_account_store ());
@@ -494,15 +494,17 @@ current_connection (void)
                ConIcIap *iap = tny_maemo_conic_device_get_iap (
                        TNY_MAEMO_CONIC_DEVICE (device), iap_id);
                const gchar *bearer_type = con_ic_iap_get_bearer_type (iap);
-                       
-               if (!strcmp (bearer_type, CON_IC_BEARER_WLAN_INFRA) ||
-                   !strcmp (bearer_type, CON_IC_BEARER_WLAN_ADHOC))
-                       retval = MODEST_CONNECTED_VIA_WLAN;
-               else
-                       retval = MODEST_CONNECTED_VIA_ANY;
+               if (bearer_type) {
+                       if (!strcmp (bearer_type, CON_IC_BEARER_WLAN_INFRA) ||
+                           !strcmp (bearer_type, CON_IC_BEARER_WLAN_ADHOC))
+                               retval = MODEST_CONNECTED_VIA_WLAN;
+                       else
+                               retval = MODEST_CONNECTED_VIA_ANY;
+               }
        
                g_object_unref (iap);
        }
+       
        g_object_unref (device);
 
        return retval;