Skip to content

Commit

Permalink
Fix a crash new app template when createRootView is invoked with nu…
Browse files Browse the repository at this point in the history
…ll bundle (#36796)

Summary:
Pull Request resolved: #36796

As the title says, this fixes a instacrash on template when `createRootView` is invoked with
a bundle being null. The crash was happening as the parameter, despite being not used, is
specified as `Bundle` and is not nullable. When the Java caller passes `null`, the app crashes.

Changelog:
[Android] [Fixed] - Fix a crash new app template when `createRootView` is invoked with null bundle

Reviewed By: cipolleschi

Differential Revision: D44668305

fbshipit-source-id: 1150ddac26f19765e7340878c8850d8462c6f3fd
  • Loading branch information
cortinico authored and facebook-github-bot committed Apr 4, 2023
1 parent efef8eb commit 9909711
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ open class DefaultReactActivityDelegate(
override fun createRootView(): ReactRootView =
ReactRootView(context).apply { setIsFabric(fabricEnabled) }

override fun createRootView(bundle: Bundle): ReactRootView =
override fun createRootView(bundle: Bundle?): ReactRootView =
ReactRootView(context).apply { setIsFabric(fabricEnabled) }
}

0 comments on commit 9909711

Please sign in to comment.