diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp index e95810aaba6..2dcb5d36c2c 100644 --- a/src/cascadia/TerminalApp/TerminalPage.cpp +++ b/src/cascadia/TerminalApp/TerminalPage.cpp @@ -1723,7 +1723,10 @@ namespace winrt::TerminalApp::implementation // the control here instead. if (_startupState == StartupState::Initialized) { - _GetActiveControl().Focus(FocusState::Programmatic); + if (const auto control = _GetActiveControl()) + { + control.Focus(FocusState::Programmatic); + } } } CATCH_LOG();