Fix wrong CommandPallete access (#17069)

Closes: #17032

We were wrongly calling the Ctor of CommandPalette which led to the
creation of an uninitialized winrt command palette object, and then
OnCreateAutomationPeer() was called on that. This seems to be the cause
of #17032.

## Validation Steps Performed
- Open WT.
- Try to tear off a tab out of the tab headers view.
- WT doesn't crash.
This commit is contained in:
Tushar Singh 2024-04-17 00:30:31 +05:30 committed by GitHub
parent 11c4aa459d
commit d632c39cc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -881,7 +881,10 @@ namespace winrt::TerminalApp::implementation
}
}
CommandPalette().Visibility(Visibility::Collapsed);
if (const auto p = CommandPaletteElement())
{
p.Visibility(Visibility::Collapsed);
}
_UpdateTabView();
}