From d72e01d9e8a9fef7637baf573515539dafc6ec5e Mon Sep 17 00:00:00 2001 From: Lulu Wu Date: Mon, 25 Sep 2023 06:38:40 -0700 Subject: [PATCH] Fix crash "lateinit property initialProps has not been initialized" Summary: Found a new [crash](P837035842) caused by converting RNTesterActivity to kotlin in D49506304 Changelog: [Android][Changed] - fix crash "lateinit property initialProps has not been initialized" Reviewed By: cortinico Differential Revision: D49594073 --- .../src/main/java/com/facebook/react/uiapp/RNTesterActivity.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterActivity.kt b/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterActivity.kt index 397b702284134c..e2e13d7dc96f0f 100644 --- a/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterActivity.kt +++ b/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterActivity.kt @@ -31,7 +31,8 @@ class RNTesterActivity : ReactActivity() { super.onCreate(savedInstanceState) } - override fun getLaunchOptions() = initialProps + override fun getLaunchOptions() = + if (this::initialProps.isInitialized) initialProps else Bundle() } override fun createReactActivityDelegate() = RNTesterActivityDelegate(this, mainComponentName)