[scene] Avoid a crash when currentPixmap is invalid and previousPixmap is null or invalid
This commit is contained in:
parent
051cba15ce
commit
1a50c98f4a
1 changed files with 4 additions and 2 deletions
6
scene.h
6
scene.h
|
@ -670,11 +670,13 @@ template <typename T>
|
||||||
inline
|
inline
|
||||||
T *Scene::Window::windowPixmap() const
|
T *Scene::Window::windowPixmap() const
|
||||||
{
|
{
|
||||||
if (m_currentPixmap->isValid()) {
|
if (m_currentPixmap && m_currentPixmap->isValid()) {
|
||||||
return static_cast<T*>(m_currentPixmap.data());
|
return static_cast<T*>(m_currentPixmap.data());
|
||||||
} else {
|
}
|
||||||
|
if (m_previousPixmap && m_previousPixmap->isValid()) {
|
||||||
return static_cast<T*>(m_previousPixmap.data());
|
return static_cast<T*>(m_previousPixmap.data());
|
||||||
}
|
}
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|
Loading…
Reference in a new issue