summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-03-04 11:03:57 +0100
committerThomas Haller <thaller@redhat.com>2016-03-04 11:09:54 +0100
commit22468c05291d3d88ddc68f8983bffe54f29f5f82 (patch)
treed43d0d517ae3e98fc85a53a5a051690dda814187
parent243f1686a3771fb8e3ec5247e53e41d90f29a1cd (diff)
applet: workaround crash in applet code
rh#1313866 and rh#1314650 show a crash due to "g_assert (s_con)". It's unclear how this can happen, but for now downgrade the crash to a warning. https://bugzilla.redhat.com/show_bug.cgi?id=1313866 https://bugzilla.redhat.com/show_bug.cgi?id=1314650
-rw-r--r--src/applet.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/applet.c b/src/applet.c
index 7ba77448..85f535cd 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -1082,7 +1082,6 @@ applet_get_first_active_vpn_connection (NMApplet *applet,
for (i = 0; active_list && (i < active_list->len); i++) {
NMActiveConnection *candidate;
NMConnection *connection;
- NMSettingConnection *s_con;
candidate = g_ptr_array_index (active_list, i);
@@ -1090,10 +1089,12 @@ applet_get_first_active_vpn_connection (NMApplet *applet,
if (!connection)
continue;
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
+ /* FIXME: rh#1313866 crashed on the following invariants for unknown reasons.
+ * Downgrade crash to warning. */
+ g_warn_if_fail (NM_IS_CONNECTION (connection));
+ g_warn_if_fail (NM_IS_SETTING (nm_connection_get_setting_connection (connection)));
- if (!strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_VPN_SETTING_NAME)) {
+ if (nm_streq0 (nm_connection_get_connection_type (connection), NM_SETTING_VPN_SETTING_NAME)) {
if (out_state)
*out_state = nm_vpn_connection_get_vpn_state (NM_VPN_CONNECTION (candidate));
return candidate;