Don't assume xdg_surface.{toplevel,popup} is non-NULL

This assumption will become incorrect with future commits.
This commit is contained in:
Kirill Primak 2023-07-26 10:50:09 +03:00 committed by Simon Ser
parent f0cc712af1
commit 10ba8ebc70
4 changed files with 44 additions and 20 deletions

View file

@ -59,8 +59,10 @@ static void scene_xdg_surface_update_position(
if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) {
struct wlr_xdg_popup *popup = xdg_surface->popup;
wlr_scene_node_set_position(&scene_xdg_surface->tree->node,
popup->current.geometry.x, popup->current.geometry.y);
if (popup != NULL) {
wlr_scene_node_set_position(&scene_xdg_surface->tree->node,
popup->current.geometry.x, popup->current.geometry.y);
}
}
}