diff --git a/src/cascadia/Remoting/WindowManager.cpp b/src/cascadia/Remoting/WindowManager.cpp index 4cafee145a0..5fc8b1eed00 100644 --- a/src/cascadia/Remoting/WindowManager.cpp +++ b/src/cascadia/Remoting/WindowManager.cpp @@ -252,8 +252,11 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation if (_peasant) { - // Inform the monarch of the time we were last activated - _monarch.HandleActivatePeasant(_peasant.GetLastActivatedArgs()); + if (const auto& lastActivated{ _peasant.GetLastActivatedArgs() }) + { + // Inform the monarch of the time we were last activated + _monarch.HandleActivatePeasant(lastActivated); + } } if (!_isKing)