LibGUI: Actually try something in TabWidget::try_add_widget(Widget&)

This function, while returning an `ErrorOr<void>`, didn't call failable
API.
This commit is contained in:
Lucas CHOLLET 2022-12-12 22:43:27 +01:00 committed by Linus Groh
parent 43ff500a80
commit 664117564a

View file

@ -53,8 +53,8 @@ TabWidget::TabWidget()
ErrorOr<void> TabWidget::try_add_widget(Widget& widget)
{
m_tabs.append({ widget.title(), nullptr, &widget, false });
add_child(widget);
TRY(m_tabs.try_append({ widget.title(), nullptr, &widget, false }));
TRY(try_add_child(widget));
update_focus_policy();
if (on_tab_count_change)
on_tab_count_change(m_tabs.size());