summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Villenave <[email protected]>2021-10-07 11:08:34 +0200
committerraveit65 <[email protected]>2021-10-26 16:00:45 +0200
commitb58d5a379f2dfe8f31b97f8601ce8d311538e6ff (patch)
tree21e8b79640b6ae48cf1086f9f856510d478e2e60
parent6844a9aed9eb51cb7675510d63d9b8d3c70aeaa5 (diff)
downloadmate-applets-b58d5a379f2dfe8f31b97f8601ce8d311538e6ff.tar.bz2
mate-applets-b58d5a379f2dfe8f31b97f8601ce8d311538e6ff.tar.xz
Mate Sticky notes applet: fix segfault when Caja isn’t running
-rw-r--r--stickynotes/stickynotes_applet_callbacks.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/stickynotes/stickynotes_applet_callbacks.c b/stickynotes/stickynotes_applet_callbacks.c
index 7b454f5b..c0889df2 100644
--- a/stickynotes/stickynotes_applet_callbacks.c
+++ b/stickynotes/stickynotes_applet_callbacks.c
@@ -172,6 +172,12 @@ void install_check_click_on_desktop (void)
window = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (),
desktop_window);
+ /* Avoid crash if the desktop window ID is set but invalid, e.g. if
+ * Caja has set it but quit since then */
+ if (!window) {
+ return;
+ }
+
/* It may contain an atom to tell us which other window to monitor */
user_time_window = gdk_x11_get_xatom_by_name ("_NET_WM_USER_TIME_WINDOW");
user_time = gdk_x11_get_xatom_by_name ("_NET_WM_USER_TIME");