From 425dbdf0b06bb6736f3e8047989a3c295333b4a5 Mon Sep 17 00:00:00 2001 From: Alexey Soshin Date: Thu, 1 Oct 2026 02:22:57 -0700 Subject: [PATCH] Remove redundant Promise safe calls Summary: Call the non-null Promise parameter directly in the sample TurboModule implementation. Changelog: [Internal] Differential Revision: D122212851 --- .../samples/platform/android/SampleTurboModule.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/android/SampleTurboModule.kt b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/android/SampleTurboModule.kt index cbddd17eb4a..f9ca4bb11a0 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/android/SampleTurboModule.kt +++ b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/android/SampleTurboModule.kt @@ -281,13 +281,13 @@ public class SampleTurboModule(private val context: ReactApplicationContext) : @Suppress("unused") override fun getValueWithPromise(error: Boolean, promise: Promise) { if (error) { - promise?.reject( + promise.reject( "code 1", "intentional promise rejection", Throwable("promise intentionally rejected"), ) } else { - promise?.resolve("result") + promise.resolve("result") } }