[gnome-panel] libpanel-applet: don't set background on invalid window



commit 696f8490fbb7a9b4e49e806701f9f961a85c1332
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Nov 21 02:17:26 2014 +0200

    libpanel-applet: don't set background on invalid window

 libpanel-applet/panel-applet.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/libpanel-applet/panel-applet.c b/libpanel-applet/panel-applet.c
index cc9ae01..e5ba44c 100644
--- a/libpanel-applet/panel-applet.c
+++ b/libpanel-applet/panel-applet.c
@@ -1518,7 +1518,14 @@ static void
 panel_applet_update_background_for_widget (GtkWidget       *widget,
                                           cairo_pattern_t *pattern)
 {
-       gdk_window_set_background_pattern (gtk_widget_get_window (widget),
+       GdkWindow *window;
+
+       window = gtk_widget_get_window (widget);
+
+       if (!window)
+               return;
+
+       gdk_window_set_background_pattern (window,
                                           pattern);
 }
 


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