From e9ca8d6b460ac5556d4035fc71712cb56f4911bf Mon Sep 17 00:00:00 2001 From: Jon Wiswall Date: Mon, 13 Apr 2026 15:26:44 -0700 Subject: [PATCH] Guard island input site fallback during shutdown --- src/dxaml/xcp/core/core/elements/depends.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/dxaml/xcp/core/core/elements/depends.cpp b/src/dxaml/xcp/core/core/elements/depends.cpp index 0b42f0cab9..4ca3a52057 100644 --- a/src/dxaml/xcp/core/core/elements/depends.cpp +++ b/src/dxaml/xcp/core/core/elements/depends.cpp @@ -323,7 +323,7 @@ wrl::ComPtr CDependencyObject::GetElementIsla return spPopup->GetIslandInputSite(); } - if (coreServices->HasXamlIslandRoots()) + if (coreServices && coreServices->HasXamlIslandRoots()) { // If this element is in a XamlIslandRoot tree, return the IslandInputSite for that island. auto root = coreServices->GetRootForElement(this); @@ -336,7 +336,15 @@ wrl::ComPtr CDependencyObject::GetElementIsla } // By default, return the primary IslandInputSite that was registered with InputServices on startup. - return coreServices->GetInputServices()->GetPrimaryRegisteredIslandInputSite(); + if (coreServices) + { + if (auto inputServices = coreServices->GetInputServices()) + { + return inputServices->GetPrimaryRegisteredIslandInputSite(); + } + } + + return nullptr; } HWND CDependencyObject::GetElementPositioningWindow()