From f162757feaee83ca9958cf86c54c7e615884f64f Mon Sep 17 00:00:00 2001 From: Martin Xu Date: Sun, 26 Sep 2010 13:48:37 +0800 Subject: [PATCH] Check device before call connman_device_set_string at ofono plugin Fixes BMC#6681 --- plugins/ofono.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/ofono.c b/plugins/ofono.c index 02d4770..50ed370 100644 --- a/plugins/ofono.c +++ b/plugins/ofono.c @@ -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; -- 2.7.4