From f8e13868dd28f556f24b2bfd2577afe3f61b8efd Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Wed, 4 Oct 2017 19:33:56 -0700 Subject: [PATCH] Fixed crash in [UIManager setLocalData:] Summary: This is pretty normal and harmless case, we should not crash here. I plan to refactor similar places in this file soon. Reviewed By: AaaChiuuu Differential Revision: D5983443 fbshipit-source-id: 922fea8ed12ebef45d249f16739aa81fe3254f19 --- React/Modules/RCTUIManager.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/React/Modules/RCTUIManager.m b/React/Modules/RCTUIManager.m index e4bcc58302df6d..510ca398d98b19 100644 --- a/React/Modules/RCTUIManager.m +++ b/React/Modules/RCTUIManager.m @@ -317,7 +317,10 @@ - (void)setLocalData:(NSObject *)localData forView:(UIView *)view RCTExecuteOnUIManagerQueue(^{ RCTShadowView *shadowView = self->_shadowViewRegistry[tag]; - RCTAssert(shadowView != nil, @"Could not locate shadow view with tag #%@", tag); + if (shadowView == nil) { + RCTLogWarn(@"Could not locate shadow view with tag #%@, this is probably caused by a temporary inconsistency between native views and shadow views.", tag); + return; + } shadowView.localData = localData; [self setNeedsLayout];