mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-12-23 10:29:49 +01:00
xdg_shell popup: fix potential segv in handle_destroy
surface could be NULL there if the popup had been made inert before
This commit is contained in:
parent
9f1d6c58ed
commit
970687a01c
2 changed files with 2 additions and 2 deletions
|
@ -186,7 +186,7 @@ static void xdg_popup_handle_destroy(struct wl_client *client,
|
|||
struct wlr_xdg_surface *surface =
|
||||
wlr_xdg_surface_from_popup_resource(resource);
|
||||
|
||||
if (!wl_list_empty(&surface->popups)) {
|
||||
if (surface && !wl_list_empty(&surface->popups)) {
|
||||
wl_resource_post_error(surface->client->resource,
|
||||
XDG_WM_BASE_ERROR_NOT_THE_TOPMOST_POPUP,
|
||||
"xdg_popup was destroyed while it was not the topmost popup");
|
||||
|
|
|
@ -214,7 +214,7 @@ static void xdg_popup_handle_destroy(struct wl_client *client,
|
|||
struct wlr_xdg_surface_v6 *surface =
|
||||
xdg_surface_from_xdg_popup_resource(resource);
|
||||
|
||||
if (!wl_list_empty(&surface->popups)) {
|
||||
if (surface && !wl_list_empty(&surface->popups)) {
|
||||
wl_resource_post_error(surface->client->resource,
|
||||
ZXDG_SHELL_V6_ERROR_NOT_THE_TOPMOST_POPUP,
|
||||
"xdg_popup was destroyed while it was not the topmost popup");
|
||||
|
|
Loading…
Reference in a new issue