backends/drm: don't crash if the surface is nullptr

CCBUG: 474987
This commit is contained in:
Xaver Hugl 2023-09-28 15:47:45 +02:00
parent 1e6f46eb0c
commit d33c6b5409

View file

@ -168,6 +168,9 @@ bool EglGbmLayerSurface::endRendering(const QRegion &damagedRegion)
std::chrono::nanoseconds EglGbmLayerSurface::queryRenderTime() const std::chrono::nanoseconds EglGbmLayerSurface::queryRenderTime() const
{ {
if (!m_surface) {
return std::chrono::nanoseconds::zero();
}
const auto cpuTime = m_surface->renderEnd - m_surface->renderStart; const auto cpuTime = m_surface->renderEnd - m_surface->renderStart;
if (m_surface->timeQuery) { if (m_surface->timeQuery) {
m_eglBackend->makeCurrent(); m_eglBackend->makeCurrent();