Skip to content

Commit

Permalink
Allow RemoveTab to work on tabsets with no panels (mikke89#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
exjam authored and alml committed Jan 2, 2024
1 parent 3586dac commit 7e199c1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Source/Core/Elements/ElementTabSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ void ElementTabSet::RemoveTab(int tab_index)
return;

Element* panels = GetChildByTag("panels");
Element* tabs = GetChildByTag("tabs");

if (panels->GetNumChildren() > tab_index && tabs->GetNumChildren() > tab_index)
if (panels->GetNumChildren() > tab_index)
{
panels->RemoveChild(panels->GetChild(tab_index));
}

Element* tabs = GetChildByTag("tabs");
if (tabs->GetNumChildren() > tab_index)
{
tabs->RemoveChild(tabs->GetChild(tab_index));
}
}
Expand Down

0 comments on commit 7e199c1

Please sign in to comment.