1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:57:45 +00:00

LibGUI+Browser: Fix crash when activating a "Tab n" action

Previously we would try setting the tab index regardless if that tab
actually existed, resulting in Browser crashing by either pressing
Control + N or using the CommandPalette.
This commit is contained in:
networkException 2022-06-05 13:08:09 +02:00 committed by Linus Groh
parent 971d6ce16f
commit 52ee5026ea
2 changed files with 4 additions and 1 deletions

View file

@ -29,6 +29,7 @@ public:
bool has_vertical_tabs() const { return m_tab_position == TabPosition::Left || m_tab_position == TabPosition::Right; }
Optional<size_t> active_tab_index() const;
size_t tab_count() { return m_tabs.size(); }
Widget* active_widget() { return m_active_widget.ptr(); }
Widget const* active_widget() const { return m_active_widget.ptr(); }