Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve android crash on display modal (#35380)
Summary: From exception logging, found crashes due to `Attempt to invoke virtual method 'int android.view.ViewGroup.getChildCount()' on a null object reference`. Tracing through the stack, it appears the constructor for `ViewGroup` conditionally calls `initializeScrollbarsInternal()`, which in turn calls `getChildCount()`. However `ReactModalHostView` overrides `getChildCount()`, so `getChildCount()` is called before `ReactModalHostView` constructor completes, resulting in null reference when accessing `mHostView` from `getChildCount()`. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [Android] [Fixed] - Fix crash on initialize modal Pull Request resolved: #35380 Test Plan: In the rn-tester project, display a modal. Reviewed By: javache, cipolleschi Differential Revision: D41392235 Pulled By: ryancat fbshipit-source-id: ce78e4d458ad41769e78139ea0a8a038384e830d
- Loading branch information