view: subsurface NULL check in view_from_wlr_surface

Necessary NULL checks had been added to xdg_shell and xwayland surfaces,
but subsurfaces had been missed.
This commit is contained in:
Kenny Levinsen 2021-03-24 00:49:13 +01:00 committed by Simon Ser
parent 03daa53a0e
commit d79ea9a0db
1 changed files with 3 additions and 0 deletions

View File

@ -1157,6 +1157,9 @@ struct sway_view *view_from_wlr_surface(struct wlr_surface *wlr_surface) {
if (wlr_surface_is_subsurface(wlr_surface)) {
struct wlr_subsurface *subsurface =
wlr_subsurface_from_wlr_surface(wlr_surface);
if (subsurface == NULL) {
return NULL;
}
return view_from_wlr_surface(subsurface->parent);
}
if (wlr_surface_is_layer_surface(wlr_surface)) {