summaryrefslogtreecommitdiff
path: root/client.h
diff options
context:
space:
mode:
Diffstat (limited to 'client.h')
-rw-r--r--client.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/client.h b/client.h
index 49982e0..38330d5 100644
--- a/client.h
+++ b/client.h
@@ -304,7 +304,9 @@ toplevel_from_popup(struct wlr_xdg_popup *popup)
while (1) {
switch (surface->role) {
case WLR_XDG_SURFACE_ROLE_POPUP:
- if (wlr_surface_is_layer_surface(surface->popup->parent))
+ if (!surface->popup->parent)
+ return NULL;
+ else if (wlr_surface_is_layer_surface(surface->popup->parent))
return wlr_layer_surface_v1_from_wlr_surface(surface->popup->parent)->data;
else if (!wlr_surface_is_xdg_surface(surface->popup->parent))
return NULL;