diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-09-08 12:03:48 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-09-09 01:14:49 +0200 |
commit | aa5f3c829c308b6765aa390524ad840bd33258e8 (patch) | |
tree | 9fa01efacafe74dabdb83aa1e0632a72b1b369cf /src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp | |
parent | d9d18596e2b242c43e64281e6a13396d329f686d (diff) |
Avoid crashing in offscreen with X11 builtin but not available
Pick-to: 5.15
Change-Id: Id385bc750f1cc6dfc2ad7e0248dbc56fa5b6e4d2
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp')
-rw-r--r-- | src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp | 6 |
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 c866a55dc0..bb4d8aeaa1 100644 --- a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp +++ b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.cpp @@ -118,13 +118,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; |