From 552d1355b7430c536d2b18deb497158f027657c0 Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Tue, 9 Jun 2026 14:08:48 -0700 Subject: [PATCH 1/2] Fix crash attempting to get runtime when shutting down instance --- vnext/Microsoft.ReactNative.Cxx/NativeModules.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vnext/Microsoft.ReactNative.Cxx/NativeModules.h b/vnext/Microsoft.ReactNative.Cxx/NativeModules.h index e9afcef5b23..a0314573c63 100644 --- a/vnext/Microsoft.ReactNative.Cxx/NativeModules.h +++ b/vnext/Microsoft.ReactNative.Cxx/NativeModules.h @@ -527,7 +527,8 @@ struct ModuleJsiInitMethodInfo(module), method]( ReactContext const &reactContext, winrt::Windows::Foundation::IInspectable const &runtimeHandle) noexcept { - (module->*method)(reactContext, GetOrCreateContextRuntime(reactContext, runtimeHandle)); + if (runtimeHandle) + (module->*method)(reactContext, GetOrCreateContextRuntime(reactContext, runtimeHandle)); }; } }; From 1ba64fdee65cd905e87cc6e9c40ef1aaab62d8ce Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Tue, 9 Jun 2026 14:22:35 -0700 Subject: [PATCH 2/2] Change files --- ...ative-windows-7a98fbf7-0186-4130-b6ab-409caa188bee.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/react-native-windows-7a98fbf7-0186-4130-b6ab-409caa188bee.json diff --git a/change/react-native-windows-7a98fbf7-0186-4130-b6ab-409caa188bee.json b/change/react-native-windows-7a98fbf7-0186-4130-b6ab-409caa188bee.json new file mode 100644 index 00000000000..b86d2e83c9b --- /dev/null +++ b/change/react-native-windows-7a98fbf7-0186-4130-b6ab-409caa188bee.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Fix crash attempting to get runtime when shutting down instance", + "packageName": "react-native-windows", + "email": "30809111+acoates-ms@users.noreply.github.com", + "dependentChangeType": "patch" +}