summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-09-08 12:03:48 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-09-09 02:12:16 +0000
commitfbe6a6e1680e816d72b10323b315446ff4c4ad83 (patch)
treed3d4229d7b6bfdca61a2da3cd6fe61fda5c7510f /src/plugins
parent4ea133962cf480b23a11454026a4ee5a0c9f8f18 (diff)
downloadqtbase-fbe6a6e1680e816d72b10323b315446ff4c4ad83.tar.gz
Avoid crashing in offscreen with X11 builtin but not available
Change-Id: Id385bc750f1cc6dfc2ad7e0248dbc56fa5b6e4d2 Reviewed-by: Michal Klocek <michal.klocek@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit aa5f3c829c308b6765aa390524ad840bd33258e8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp
index 84991d751f..9c391e2be7 100644
--- a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp
+++ b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp
@@ -119,13 +119,15 @@ void *QOffscreenX11Integration::nativeResourceForContext(const QByteArray &resou
if (resource.toLower() == QByteArrayLiteral("glxconfig") ) {
if (context) {
QOffscreenX11GLXContext *glxPlatformContext = static_cast<QOffscreenX11GLXContext *>(context->handle());
- return glxPlatformContext->glxConfig();
+ if (glxPlatformContext)
+ return glxPlatformContext->glxConfig();
}
}
if (resource.toLower() == QByteArrayLiteral("glxcontext") ) {
if (context) {
QOffscreenX11GLXContext *glxPlatformContext = static_cast<QOffscreenX11GLXContext *>(context->handle());
- return glxPlatformContext->glxContext();
+ if (glxPlatformContext)
+ return glxPlatformContext->glxContext();
}
}
return nullptr;