Make sure we don't try to remove tabs when they don't exist (#5742)
This was an oversight. Fixes #5738.
This commit is contained in:
parent
7d54bc5ecb
commit
046fed3d97
|
@ -828,9 +828,11 @@ namespace winrt::TerminalApp::implementation
|
|||
void TerminalPage::_RemoveTabViewItem(const MUX::Controls::TabViewItem& tabViewItem)
|
||||
{
|
||||
uint32_t tabIndexFromControl = 0;
|
||||
_tabView.TabItems().IndexOf(tabViewItem, tabIndexFromControl);
|
||||
|
||||
_RemoveTabViewItemByIndex(tabIndexFromControl);
|
||||
if (_tabView.TabItems().IndexOf(tabViewItem, tabIndexFromControl))
|
||||
{
|
||||
// If IndexOf returns true, we've actually got an index
|
||||
_RemoveTabViewItemByIndex(tabIndexFromControl);
|
||||
}
|
||||
}
|
||||
|
||||
// Method Description:
|
||||
|
|
Loading…
Reference in a new issue