seatmgr: avoid crash on null surfs

This commit is contained in:
Vaxry
2025-03-18 19:43:05 +00:00
parent cca0f48b74
commit 03385fc07f

View File

@@ -606,11 +606,11 @@ void CSeatManager::setGrab(SP<CSeatGrab> grab) {
if (!refocus) {
surf = CWLSurface::fromResource(currentFocus);
layer = surf->getLayer();
layer = surf ? surf->getLayer() : nullptr;
}
if (!refocus && !layer) {
auto popup = surf->getPopup();
auto popup = surf ? surf->getPopup() : nullptr;
if (popup) {
auto parent = popup->getT1Owner();
layer = parent->getLayer();