diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2023-01-08 15:45:04 +0200 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2023-01-08 15:45:04 +0200 |
commit | e2e94ed5c3e6546e4a7653280e02f4fcd4a0f20b (patch) | |
tree | 8773e6180636e63b5f76b0f49d198b53f75a74b4 | |
parent | b416f9b3465e90a68c4961778622bb7b3278d19c (diff) | |
download | libwnck-wip/muktupavels/issue-157.tar.gz |
handle: avoid segfault in init_xreswip/muktupavels/issue-157
Under Wayland display will be NULL, add early return to avoid
segfault.
https://gitlab.gnome.org/GNOME/libwnck/-/issues/157
-rw-r--r-- | libwnck/wnck-handle.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libwnck/wnck-handle.c b/libwnck/wnck-handle.c index e6d776b..0ea789e 100644 --- a/libwnck/wnck-handle.c +++ b/libwnck/wnck-handle.c @@ -185,6 +185,10 @@ init_xres (WnckHandle *self) int minor; xdisplay = _wnck_get_default_display (); + + if (xdisplay == NULL) + return; + event_base = error_base = major = minor = 0; if (XResQueryExtension (xdisplay, &event_base, &error_base) && |