From de454a7e93f70cf8f57645a57c4d772599a1a12e Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Tue, 9 Jun 2026 14:04:54 -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 84a9336202ddbf963db5a346adc3efb7f83ad31c Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Tue, 9 Jun 2026 14:05:17 -0700 Subject: [PATCH 2/2] Change files --- ...ative-windows-9b754faa-3023-4dbd-a53a-7c2ac8f2f26a.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/react-native-windows-9b754faa-3023-4dbd-a53a-7c2ac8f2f26a.json diff --git a/change/react-native-windows-9b754faa-3023-4dbd-a53a-7c2ac8f2f26a.json b/change/react-native-windows-9b754faa-3023-4dbd-a53a-7c2ac8f2f26a.json new file mode 100644 index 00000000000..6c8855ded73 --- /dev/null +++ b/change/react-native-windows-9b754faa-3023-4dbd-a53a-7c2ac8f2f26a.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "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" +}