Skip to content

Commit

Permalink
Fixed crash in [UIManager setLocalData:]
Browse files Browse the repository at this point in the history
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 f8e1386
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion React/Modules/RCTUIManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit f8e1386

Please sign in to comment.