From 0420bcc1a838a55b3315fcc2e6e99870e0e5083d Mon Sep 17 00:00:00 2001 From: Daniele Conti Date: Mon, 11 Jun 2018 13:13:56 +0100 Subject: [PATCH] Check for view existence before setting children --- .../java/com/facebook/react/uimanager/UIImplementation.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java index c1adee2e6ccacf..f56b2fd85bdc92 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java @@ -479,6 +479,11 @@ public void setChildren( ReactShadowNode cssNodeToManage = mShadowNodeRegistry.getNode(viewTag); + if (cssNodeToManage == null) { + FLog.w(ReactConstants.TAG, "Tried to set children on non-existent root tag: " + viewTag); + return; + } + for (int i = 0; i < childrenTags.size(); i++) { ReactShadowNode cssNodeToAdd = mShadowNodeRegistry.getNode(childrenTags.getInt(i)); if (cssNodeToAdd == null) {