diff options
author | Valentin Villenave <[email protected]> | 2021-10-07 11:08:34 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2021-11-09 22:38:39 +0100 |
commit | a2b794394901ab1fc5fcf7875c4ad73aa3ba6f1b (patch) | |
tree | 4e5358eab3eb00cfd8971b16a2178cfcc6f8e68a | |
parent | ec2bbbde3d024fde4dfa0a7269bbfdb83251e1ad (diff) | |
download | mate-applets-a2b794394901ab1fc5fcf7875c4ad73aa3ba6f1b.tar.bz2 mate-applets-a2b794394901ab1fc5fcf7875c4ad73aa3ba6f1b.tar.xz |
Mate Sticky notes applet: fix segfault when Caja isn’t running
-rw-r--r-- | stickynotes/stickynotes_applet_callbacks.c | 6 |
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"); |