From f905ae33c898945bc19796989064899a9af1b48f Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Tue, 19 Jul 2022 13:54:42 +0200 Subject: [PATCH] guard pSurface in unmapsubsurface --- src/helpers/SubsurfaceTree.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/helpers/SubsurfaceTree.cpp b/src/helpers/SubsurfaceTree.cpp index c511b900..376153f5 100644 --- a/src/helpers/SubsurfaceTree.cpp +++ b/src/helpers/SubsurfaceTree.cpp @@ -171,12 +171,14 @@ void Events::listener_unmapSubsurface(void* owner, void* data) { addSurfaceGlobalOffset(PNODE, &lx, &ly); wlr_box extents = {0}; - wlr_surface_get_extends(PNODE->pSurface, &extents); + if (PNODE->pSurface) { + wlr_surface_get_extends(PNODE->pSurface, &extents); - extents.x += lx; - extents.y += ly; + extents.x += lx; + extents.y += ly; - g_pHyprRenderer->damageBox(&extents); + g_pHyprRenderer->damageBox(&extents); + } SubsurfaceTree::destroySurfaceTree(subsurface->pChild); subsurface->pChild = nullptr;