From 23d2f8745c8f1aba7afdf111c4a7a92e16a8dbef Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Fri, 6 Oct 2023 07:08:04 +0100 Subject: [PATCH] wlserver: Fix rare crash on shutdown --- src/wlserver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wlserver.cpp b/src/wlserver.cpp index eef2f9a36..100cc9c67 100644 --- a/src/wlserver.cpp +++ b/src/wlserver.cpp @@ -1144,7 +1144,7 @@ static bool filter_global(const struct wl_client *client, const struct wl_global * the server. */ for (size_t i = 0; i < wlserver.wlr.xwayland_servers.size(); i++) { gamescope_xwayland_server_t *server = wlserver.wlr.xwayland_servers[i].get(); - if (server->get_client() == client) + if (server && server->get_client() == client) return server->get_output() == output; } @@ -1154,7 +1154,7 @@ static bool filter_global(const struct wl_client *client, const struct wl_global gamescope_xwayland_server_t *server = wlserver.wlr.xwayland_servers[0].get(); /* If we aren't an xwayland server, then only expose the first wl_output * that's associated with from server 0. */ - return server->get_output() == output; + return server && server->get_output() == output; } bool wlsession_init( void ) {