Skip to content

Commit

Permalink
Fix crash accessing empty list of sprites updating ContextBar fields (f…
Browse files Browse the repository at this point in the history
…ix #4407)

Not sure if this will be the final solution for this crash, as a Doc
shouldn't have an empty list of sprites.
  • Loading branch information
dacap committed Apr 8, 2024
1 parent fd2a98c commit 4d5bf53
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/ui/context_bar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1770,7 +1770,9 @@ class ContextBar::SliceFields : public HBox {
}

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());

Expand Down

0 comments on commit 4d5bf53

Please sign in to comment.