[network-manager-applet/nma-0-9-10] applet: do not crash when ModemManager is not available (rh #1199288)
- From: Jiří Klimeš <jklimes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/nma-0-9-10] applet: do not crash when ModemManager is not available (rh #1199288)
- Date: Tue, 7 Apr 2015 07:55:05 +0000 (UTC)
commit 36c868498f09eacafcdce9d6b68ca5aeffaae899
Author: Jiří Klimeš <jklimes redhat com>
Date: Thu Apr 2 14:06:39 2015 +0200
applet: do not crash when ModemManager is not available (rh #1199288)
https://bugzilla.redhat.com/show_bug.cgi?id=1199288
(cherry picked from commit 98dc7a7657b2609fcac05134db99455a9de6610a)
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 72d209a..5b6d266 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_INTERNAL_ERROR,
+ "%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)
@@ -712,6 +720,11 @@ add_menu_item (NMDevice *device,
GSList *iter;
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]