diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2011-05-09 18:21:46 +0200 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2011-05-11 21:46:34 -0500 |
commit | 474ecbe06729237ba15a2c5442353758e7c8a8b8 (patch) | |
tree | 69ad6b9f186147e6dd0ce33f5a26b7238d3729f8 | |
parent | 0b9289f4bb6ff3819e5b167f21e8ffbe9a5b3785 (diff) | |
download | ModemManager-474ecbe06729237ba15a2c5442353758e7c8a8b8.tar.gz |
manager: avoid assertion warning when enumerating devices
-rw-r--r-- | src/mm-manager.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mm-manager.c b/src/mm-manager.c index 561d427c0..b9076ee6c 100644 --- a/src/mm-manager.c +++ b/src/mm-manager.c @@ -322,12 +322,15 @@ enumerate_devices_cb (gpointer key, gpointer val, gpointer user_data) { MMModem *modem = MM_MODEM (val); GPtrArray **devices = (GPtrArray **) user_data; - const char *path; if (mm_modem_get_valid (modem)) { + const char *path; + path = g_object_get_data (G_OBJECT (modem), DBUS_PATH_TAG); - g_return_if_fail (path != NULL); - g_ptr_array_add (*devices, g_strdup (path)); + /* A valid modem without dbus path may happen when enumerating devices + * while there is an ongoing modem probing. */ + if (path) + g_ptr_array_add (*devices, g_strdup (path)); } } |