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.
This commit is contained in:
Arjen Hiemstra 2022-10-20 15:05:40 +02:00
parent bb7f627acc
commit 85d46016a2

View file

@ -127,6 +127,10 @@ void SurfaceItem::preprocess()
WindowQuadList SurfaceItem::buildQuads() const WindowQuadList SurfaceItem::buildQuads() const
{ {
if (!pixmap()) {
return {};
}
const QRegion region = shape(); const QRegion region = shape();
const auto size = pixmap()->size(); const auto size = pixmap()->size();