Skip to content

Commit

Permalink
Fix crash "lateinit property initialProps has not been initialized" (#…
Browse files Browse the repository at this point in the history
…39632)

Summary:
Pull Request resolved: #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
  • Loading branch information
Lulu Wu authored and facebook-github-bot committed Sep 25, 2023
1 parent 030663b commit 188ecee
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 188ecee

Please sign in to comment.