diff options
| author | Jiří Klimeš <jklimes@redhat.com> | 2015-04-02 12:06:39 (GMT) |
|---|---|---|
| committer | Jiří Klimeš <jklimes@redhat.com> | 2015-04-07 07:33:34 (GMT) |
| commit | 98dc7a7657b2609fcac05134db99455a9de6610a (patch) | |
| tree | 3dbde0248ec4b11a40190c0440fafb9b688f7223 | |
| parent | ef2d9f5b9ec073212e2ec161a20160118085d095 (diff) | |
| download | network-manager-applet-98dc7a7657b2609fcac05134db99455a9de6610a.zip network-manager-applet-98dc7a7657b2609fcac05134db99455a9de6610a.tar.xz | |
applet: do not crash when ModemManager is not available (rh #1199288)
https://bugzilla.redhat.com/show_bug.cgi?id=1199288
| -rw-r--r-- | src/applet-device-broadband.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/applet-device-broadband.c b/src/applet-device-broadband.c index 1bf750e..bb9e966 100644 --- a/src/applet-device-broadband.c +++ b/src/applet-device-broadband.c @@ -476,7 +476,15 @@ get_secrets (SecretsRequest *req, return FALSE; devinfo = g_object_get_data (G_OBJECT (device), "devinfo"); - g_assert (devinfo); + if (!devinfo) { + g_set_error (error, + NM_SECRET_AGENT_ERROR, + NM_SECRET_AGENT_ERROR_FAILED, + "%s.%d (%s): ModemManager is not available for modem at %s", + __FILE__, __LINE__, __func__, + nm_device_get_udi (device)); + return FALSE; + } /* A GetSecrets PIN dialog overrides the initial unlock dialog */ if (devinfo->dialog) @@ -716,6 +724,11 @@ add_menu_item (NMDevice *device, int i; info = g_object_get_data (G_OBJECT (device), "devinfo"); + if (!info) { + g_warning ("ModemManager is not available for modem at %s", + nm_device_get_udi (device)); + return; + } if (multiple_devices) { const char *desc; |
