Check device before call connman_device_set_string at ofono plugin
authorMartin Xu <martin.xu@intel.com>
Sun, 26 Sep 2010 05:48:37 +0000 (13:48 +0800)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 27 Sep 2010 08:53:45 +0000 (10:53 +0200)
Fixes BMC#6681

plugins/ofono.c

index 02d4770..50ed370 100644 (file)
@@ -718,6 +718,9 @@ static void modem_roaming_changed(struct modem_data *modem,
        GHashTableIter i;
        gpointer value;
 
+       if (device == NULL)
+               return;
+
        connman_device_set_string(device, "RegistrationStatus", status);
 
        if (g_str_equal(status, "roaming"))
@@ -727,9 +730,6 @@ static void modem_roaming_changed(struct modem_data *modem,
        else
                return;
 
-       if (device == NULL)
-               return;
-
        for (g_hash_table_iter_init(&i, network_hash);
             g_hash_table_iter_next(&i, NULL, &value);) {
                struct connman_network *network = value;