diff --git a/React/CSSLayout/CSSLayout.c b/React/CSSLayout/CSSLayout.c index dadaab50c..dd63fb254 100644 --- a/React/CSSLayout/CSSLayout.c +++ b/React/CSSLayout/CSSLayout.c @@ -263,9 +263,10 @@ void CSSNodeInsertChild(const CSSNodeRef node, const CSSNodeRef child, const uin } void CSSNodeRemoveChild(const CSSNodeRef node, const CSSNodeRef child) { - CSSNodeListDelete(node->children, child); - child->parent = NULL; - _CSSNodeMarkDirty(node); + if (CSSNodeListDelete(node->children, child) != NULL) { + child->parent = NULL; + _CSSNodeMarkDirty(node); + } } CSSNodeRef CSSNodeGetChild(const CSSNodeRef node, const uint32_t index) {