Skip to content

Commit

Permalink
LibGUI: Don't crash when rendering a collapsible toolbar with no items
Browse files Browse the repository at this point in the history
This prevents a crash in GML Playground that would occur when
previewing a GUI with a collapsible toolbar.
  • Loading branch information
tcl3 authored and awesomekling committed May 15, 2024
1 parent 6876c62 commit 6290f96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Userland/Libraries/LibGUI/Toolbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ ErrorOr<void> Toolbar::create_overflow_objects()

ErrorOr<void> Toolbar::update_overflow_menu()
{
if (!m_collapsible)
if (!m_collapsible || m_items.is_empty())
return {};

Optional<size_t> marginal_index {};
Expand Down

0 comments on commit 6290f96

Please sign in to comment.