diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java b/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java index 82be75a4377fc9..b8046f5da76c21 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java @@ -120,7 +120,9 @@ public void addView(View child, int index) { @Override public int getChildCount() { - return mHostView.getChildCount(); + // This method may be called by the parent constructor + // before mHostView is initialized. + return mHostView == null ? 0 : mHostView.getChildCount(); } @Override