[network-manager-applet/jk/applet-abort-rh1205316: 2/2] 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/jk/applet-abort-rh1205316: 2/2] applet: do not crash when ModemManager is not available (rh #1199288)
- Date: Thu, 2 Apr 2015 12:14:27 +0000 (UTC)
commit b33a277cd325fd6883d92c560e2ba521aef9f2a7
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
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]