Skip to content

Commit cb91faa

Browse files
Alexey Soshinmeta-codesync[bot]
authored andcommitted
Remove redundant Promise safe calls (#58790)
Summary: Pull Request resolved: #58790 Call the non-null Promise parameter directly in the sample TurboModule implementation. Changelog: [Internal] Differential Revision: D122212851 fbshipit-source-id: cb08ff3e092ddb2ba6d5224d849380026e895545
1 parent be9fbdd commit cb91faa

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎packages/react-native/ReactCommon/react/nativemodule/samples/platform/android/SampleTurboModule.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,13 @@ public class SampleTurboModule(private val context: ReactApplicationContext) :
281281
@Suppress("unused")
282282
override fun getValueWithPromise(error: Boolean, promise: Promise) {
283283
if (error) {
284-
promise?.reject(
284+
promise.reject(
285285
"code 1",
286286
"intentional promise rejection",
287287
Throwable("promise intentionally rejected"),
288288
)
289289
} else {
290-
promise?.resolve("result")
290+
promise.resolve("result")
291291
}
292292
}
293293

0 commit comments

Comments
 (0)