diff --git a/scene.h b/scene.h index a8f714528..fdeb10e30 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