[gnome-control-center] sharing: Fix warning when disabling sharing



commit a57a85a1db9e2dc2619bc82adb435096b6a1a73c
Author: Robert Ancell <robert ancell canonical com>
Date:   Mon Oct 15 11:49:19 2018 +1300

    sharing: Fix warning when disabling sharing
    
    The warning is:
    (gnome-control-center:29760): Gtk-CRITICAL **: 11:45:48.076: gtk_widget_is_visible: assertion 
'GTK_IS_WIDGET (widget)' failed
    
    This is due to the code trying to disable switches that only exist if support
    for that feature is available.

 panels/sharing/cc-sharing-panel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c
index e62ecfc83..91c442dda 100644
--- a/panels/sharing/cc-sharing-panel.c
+++ b/panels/sharing/cc-sharing-panel.c
@@ -109,7 +109,7 @@ struct _CcSharingPanel
 
 CC_PANEL_REGISTER (CcSharingPanel, cc_sharing_panel)
 
-#define OFF_IF_VISIBLE(x, y) { if (gtk_widget_is_visible(x) && gtk_widget_is_sensitive(y)) 
gtk_switch_set_active (GTK_SWITCH(y), FALSE); }
+#define OFF_IF_VISIBLE(x, y) { if (gtk_widget_is_visible(x) && (y) != NULL && gtk_widget_is_sensitive(y)) 
gtk_switch_set_active (GTK_SWITCH(y), FALSE); }
 
 static void
 cc_sharing_panel_master_switch_notify (GtkSwitch      *gtkswitch,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]