From 85d46016a22781ae2b9eab22e1bfbe0cf35ce9fa Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 20 Oct 2022 15:05:40 +0200 Subject: [PATCH] If SurfaceItem does not have a pixmap, return an empty WindowQuadList Otherwise the caller needs to ensure that we're not calling on an item without pixmap and if we don't, things crash. --- src/surfaceitem.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/surfaceitem.cpp b/src/surfaceitem.cpp index 06a8c0278b..b29693dd66 100644 --- a/src/surfaceitem.cpp +++ b/src/surfaceitem.cpp @@ -127,6 +127,10 @@ void SurfaceItem::preprocess() WindowQuadList SurfaceItem::buildQuads() const { + if (!pixmap()) { + return {}; + } + const QRegion region = shape(); const auto size = pixmap()->size();