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.
This commit is contained in:
Robert Ancell 2018-10-15 11:49:19 +13:00
parent b47ada9b76
commit a57a85a1db

View file

@ -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,