Skip to content

Commit

Permalink
Don't attempt to split settings tabs (#13172)
Browse files Browse the repository at this point in the history
Prevents a null pointer dereference when attempting to split a settings tab, due to it not being a terminal tab.

* [x] Closes #13166

## Validation Steps Performed
Manually tested.
  • Loading branch information
ianjoneill authored May 25, 2022
1 parent 78852e0 commit 6439b4d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1822,9 +1822,17 @@ namespace winrt::TerminalApp::implementation
// Instead, let's just promote this first split to be a tab instead.
// Crash avoided, and we don't need to worry about inserting a new-tab
// command in at the start.
if (!focusedTab && _tabs.Size() == 0)
if (!focusedTab)
{
_CreateNewTabFromPane(newPane);
if (_tabs.Size() == 0)
{
_CreateNewTabFromPane(newPane);
}
else
{
// The focused tab isn't a terminal tab
return;
}
}
else
{
Expand Down

0 comments on commit 6439b4d

Please sign in to comment.