screencasting: do not attempt to copy a null texture

It seldom happens, but it does happen.
This commit is contained in:
Aleix Pol 2021-05-26 03:24:19 +02:00 committed by Aleix Pol Gonzalez
parent 870c1e5557
commit 644dcbe173

View file

@ -1593,7 +1593,7 @@ QSharedPointer<GLTexture> OpenGLWindow::windowTexture()
frame = static_cast<PlatformOpenGLSurfaceTexture *>(item->pixmap()->platformTexture()); frame = static_cast<PlatformOpenGLSurfaceTexture *>(item->pixmap()->platformTexture());
} }
if (frame && item->childItems().isEmpty()) { if (frame && item->childItems().isEmpty() && frame->texture()) {
return QSharedPointer<GLTexture>(new GLTexture(*frame->texture())); return QSharedPointer<GLTexture>(new GLTexture(*frame->texture()));
} else { } else {
auto effectWindow = window()->effectWindow(); auto effectWindow = window()->effectWindow();