Assert root node isn't null in createView

Reviewed By: mdvacca

Differential Revision: D7374406

fbshipit-source-id: 534e58e7867a9fa8e395abd587e2c808c9c7843d
This commit is contained in:
Andrew Chen (Eng) 2018-03-22 22:06:01 -07:00 committed by Facebook Github Bot
parent 0376baf4b3
commit 046d4cee8b
1 changed files with 1 additions and 0 deletions

View File

@ -276,6 +276,7 @@ public class UIImplementation {
public void createView(int tag, String className, int rootViewTag, ReadableMap props) { public void createView(int tag, String className, int rootViewTag, ReadableMap props) {
ReactShadowNode cssNode = createShadowNode(className); ReactShadowNode cssNode = createShadowNode(className);
ReactShadowNode rootNode = mShadowNodeRegistry.getNode(rootViewTag); ReactShadowNode rootNode = mShadowNodeRegistry.getNode(rootViewTag);
Assertions.assertNotNull(rootNode, "Root node with tag " + rootViewTag + " doesn't exist");
cssNode.setReactTag(tag); cssNode.setReactTag(tag);
cssNode.setViewClassName(className); cssNode.setViewClassName(className);
cssNode.setRootNode(rootNode); cssNode.setRootNode(rootNode);