Fix crash accessing empty list of sprites updating ContextBar fields (fix #4407)

Not sure if this will be the final solution for this crash, as a Doc
shouldn't have an empty list of sprites.
This commit is contained in:
David Capello 2024-04-08 10:44:44 -03:00
parent fd2a98c0e6
commit 4d5bf53be8

View File

@ -1770,7 +1770,9 @@ private:
}
void updateLayout() {
const bool visible = (m_doc && !m_doc->sprite()->slices().empty());
const bool visible = (m_doc &&
m_doc->sprite() &&
!m_doc->sprite()->slices().empty());
const bool relayout = (visible != m_combobox.isVisible() ||
visible != m_action.isVisible());