Permalink
Browse files

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
  • Loading branch information...
shergin authored and facebook-github-bot committed Oct 5, 2017
1 parent 7f6a7ae commit f8e13868dd28f556f24b2bfd2577afe3f61b8efd
Showing with 4 additions and 1 deletion.
  1. +4 −1 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];

0 comments on commit f8e1386

Please sign in to comment.