Blame SOURCES/0001-sharing-Fix-warning-when-disabling-sharing.patch

9b746a
From 5502611f0cfe7083c2b2a650385ea4554cb73ac9 Mon Sep 17 00:00:00 2001
9b746a
From: Robert Ancell <robert.ancell@canonical.com>
9b746a
Date: Mon, 15 Oct 2018 11:49:19 +1300
9b746a
Subject: [PATCH 3/4] sharing: Fix warning when disabling sharing
9b746a
9b746a
The warning is:
9b746a
(gnome-control-center:29760): Gtk-CRITICAL **: 11:45:48.076: gtk_widget_is_visible: assertion 'GTK_IS_WIDGET (widget)' failed
9b746a
9b746a
This is due to the code trying to disable switches that only exist if support
9b746a
for that feature is available.
9b746a
---
9b746a
 panels/sharing/cc-sharing-panel.c | 2 +-
9b746a
 1 file changed, 1 insertion(+), 1 deletion(-)
9b746a
9b746a
diff --git a/panels/sharing/cc-sharing-panel.c b/panels/sharing/cc-sharing-panel.c
9b746a
index 8b35c9a31..98f2d69ef 100644
9b746a
--- a/panels/sharing/cc-sharing-panel.c
9b746a
+++ b/panels/sharing/cc-sharing-panel.c
9b746a
@@ -91,7 +91,7 @@ struct _CcSharingPanelPrivate
9b746a
   guint remote_desktop_name_watch;
9b746a
 };
9b746a
 
9b746a
-#define OFF_IF_VISIBLE(x) { if (gtk_widget_is_visible(x) && gtk_widget_is_sensitive(x)) gtk_switch_set_active (GTK_SWITCH(x), FALSE); }
9b746a
+#define OFF_IF_VISIBLE(x) { if ((x) != NULL && gtk_widget_is_visible(x) && gtk_widget_is_sensitive(x)) gtk_switch_set_active (GTK_SWITCH(x), FALSE); }
9b746a
 
9b746a
 static void
9b746a
 cc_sharing_panel_master_switch_notify (GtkSwitch      *gtkswitch,
9b746a
-- 
9b746a
2.24.0
9b746a