Fix crash "lateinit property initialProps has not been initialized" (#39632)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39632

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

fbshipit-source-id: e6d086f6e9bc64b449e6a3da4bc1903729970e7d
This commit is contained in:
Lulu Wu
2023-09-25 10:36:04 -07:00
committed by Facebook GitHub Bot
parent 030663bb06
commit 188eceec98
@@ -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)