diff --git a/libtaskmanager/declarative/pipewiresourceitem.cpp b/libtaskmanager/declarative/pipewiresourceitem.cpp index b666a9383..08fb17dca 100644 --- a/libtaskmanager/declarative/pipewiresourceitem.cpp +++ b/libtaskmanager/declarative/pipewiresourceitem.cpp @@ -231,12 +231,18 @@ void PipeWireSourceItem::updateTextureDmaBuf(const QVector &planes, qCWarning(PIPEWIRE_LOGGING) << "glEGLImageTargetTexture2DOES is not available" << window(); return; } + + if (!window()) { + qCWarning(PIPEWIRE_LOGGING) << "Window not available" << this; + return; + } + #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) const auto openglContext = window()->openglContext(); #else const auto openglContext = static_cast(window()->rendererInterface()->getResource(window(), QSGRendererInterface::OpenGLContextResource)); #endif - if (!window() || !openglContext || !m_stream) { + if (!openglContext || !m_stream) { qCWarning(PIPEWIRE_LOGGING) << "need a window and a context" << window(); return; }