From 1a50c98f4a99bce3363561b953ff8d92b8f1a33a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9ven=20Car?= Date: Tue, 2 Jun 2020 09:54:55 +0200 Subject: [PATCH] [scene] Avoid a crash when currentPixmap is invalid and previousPixmap is null or invalid --- scene.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scene.h b/scene.h index a8f714528e..fdeb10e304 100644 --- a/scene.h +++ b/scene.h @@ -670,11 +670,13 @@ template inline T *Scene::Window::windowPixmap() const { - if (m_currentPixmap->isValid()) { + if (m_currentPixmap && m_currentPixmap->isValid()) { return static_cast(m_currentPixmap.data()); - } else { + } + if (m_previousPixmap && m_previousPixmap->isValid()) { return static_cast(m_previousPixmap.data()); } + return nullptr; } template