@@ -63,11 +63,20 @@ namespace winrt::TerminalApp::implementation
6363 _tabView = _tabRow.TabView ();
6464 _rearranging = false ;
6565
66- // GH#3581 - There's a platform limitation that causes us to crash when we rearrange tabs.
67- // Xaml tries to send a drag visual (to wit: a screenshot) to the drag hosting process,
68- // but that process is running at a different IL than us.
69- // For now, we're disabling elevated drag.
70- const auto isElevated = ::winrt::Windows::UI::Xaml::Application::Current ().as <::winrt::TerminalApp::App>().Logic ().IsElevated ();
66+ // GH#2455 - Make sure to try/catch calls to Application::Current,
67+ // because that _won't_ be an instance of TerminalApp::App in the
68+ // LocalTests
69+ auto isElevated = false ;
70+ try
71+ {
72+ // GH#3581 - There's a platform limitation that causes us to crash when we rearrange tabs.
73+ // Xaml tries to send a drag visual (to wit: a screenshot) to the drag hosting process,
74+ // but that process is running at a different IL than us.
75+ // For now, we're disabling elevated drag.
76+ isElevated = ::winrt::Windows::UI::Xaml::Application::Current ().as <::winrt::TerminalApp::App>().Logic ().IsUwp ();
77+ }
78+ CATCH_LOG ();
79+
7180 _tabView.CanReorderTabs (!isElevated);
7281 _tabView.CanDragTabs (!isElevated);
7382
@@ -406,6 +415,9 @@ namespace winrt::TerminalApp::implementation
406415
407416 // add static items
408417 {
418+ // GH#2455 - Make sure to try/catch calls to Application::Current,
419+ // because that _won't_ be an instance of TerminalApp::App in the
420+ // LocalTests
409421 auto isUwp = false ;
410422 try
411423 {
0 commit comments