mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 00:48:23 -06:00
Fix single-tab window tear-off crash (#17251)
## Validation Steps Performed - Opened multi-tab terminal window with Narrator. Narrator can read characters from the tabs. - Started a drag and drop (tear-off) of a tab, and it didn't crash. This was repeated multiple times.
This commit is contained in:
parent
5ce7fb7403
commit
30ef1f461d
@ -1055,8 +1055,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
// MSFT 33353327: We're purposefully not using _initializedTerminal to ensure we're fully initialized.
|
||||
// Doing so makes us return nullptr when XAML requests an automation peer.
|
||||
// Instead, we need to give XAML an automation peer, then fix it later.
|
||||
if (!_IsClosing())
|
||||
if (!_IsClosing() && !_detached)
|
||||
{
|
||||
// It's unexpected that interactivity is null even when we're not closing or in detached state.
|
||||
THROW_HR_IF_NULL(E_UNEXPECTED, _interactivity);
|
||||
|
||||
// create a custom automation peer with this code pattern:
|
||||
// (https://docs.microsoft.com/en-us/windows/uwp/design/accessibility/custom-automation-peers)
|
||||
if (const auto& interactivityAutoPeer{ _interactivity.OnCreateAutomationPeer() })
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user