diff --git a/src/scripting/thumbnailitem.cpp b/src/scripting/thumbnailitem.cpp index 58879a9d57..61bdc35514 100644 --- a/src/scripting/thumbnailitem.cpp +++ b/src/scripting/thumbnailitem.cpp @@ -145,6 +145,9 @@ QSGTextureProvider *ThumbnailItemBase::textureProvider() const void ThumbnailItemBase::handleCompositingToggled() { + if (!Compositor::self()) { + return; + } Scene *scene = Compositor::self()->scene(); if (scene && scene->compositingType() == OpenGLCompositing) { connect(scene, &Scene::frameRendered, this, &ThumbnailItemBase::updateOffscreenTexture); @@ -167,6 +170,9 @@ void ThumbnailItemBase::setSourceSize(const QSize &sourceSize) void ThumbnailItemBase::destroyOffscreenTexture() { + if (!Compositor::self()) { + return; + } Scene *scene = Compositor::self()->scene(); if (!scene || scene->compositingType() != OpenGLCompositing) { return;