Skip to content

Commit 425dbdf

Browse files
Alexey Soshinfacebook-github-bot
authored andcommitted
Remove redundant Promise safe calls
Summary: Call the non-null Promise parameter directly in the sample TurboModule implementation. Changelog: [Internal] Differential Revision: D122212851
1 parent 5954b12 commit 425dbdf

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)