diff --git a/src/plugins/platforms/drm/gbm_dmabuf.cpp b/src/plugins/platforms/drm/gbm_dmabuf.cpp index fab7bda185..2bc53a6a00 100644 --- a/src/plugins/platforms/drm/gbm_dmabuf.cpp +++ b/src/plugins/platforms/drm/gbm_dmabuf.cpp @@ -58,6 +58,9 @@ KWin::GbmDmaBuf *GbmDmaBuf::createBuffer(const QSize &size, gbm_device *device) }; EGLDisplay display = kwinApp()->platform()->sceneEglDisplay(); + if (display == EGL_NO_DISPLAY) { + return nullptr; + } EGLImageKHR destinationImage = eglCreateImageKHR(display, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, nullptr, importAttributes); if (destinationImage == EGL_NO_IMAGE_KHR) { close(fd);