Skip to content

Commit

Permalink
Allow RemoveTab to work on tabsets with no panels (#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
exjam authored Dec 6, 2023
1 parent 666690c commit bb25b88
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 bb25b88

Please sign in to comment.