mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 20:33:10 +00:00
LibGUI: Don't crash when rendering a collapsible toolbar with no items
This prevents a crash in GML Playground that would occur when previewing a GUI with a collapsible toolbar.
This commit is contained in:
parent
6876c62110
commit
6290f96aa7
|
@ -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 {};
|
||||
|
|
Loading…
Reference in a new issue