Skip to content

Commit

Permalink
Add another guard to lazilyLoadView
Browse files Browse the repository at this point in the history
Summary:
it's possible that moduleForName won't return anything, so we should return.

Created from Diffusion's 'Open in Editor' feature.

Reviewed By: spredolac

Differential Revision: D12963342

fbshipit-source-id: c059595a68bfcaa38221e05fb62d70cc29887ca7
  • Loading branch information
Mehdi Mulani authored and facebook-github-bot committed Nov 9, 2018
1 parent fba7c1e commit d7865eb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions React/Modules/RCTUIManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,10 @@ static void RCTMeasureLayout(RCTShadowView *view,
// which had RCT Prefixes stripped. Lets check one more time...
module = [self.bridge moduleForName:RCTDropReactPrefixes(moduleName)];
}

if (!module) {
return @{};
}

RCTComponentData *componentData = [[RCTComponentData alloc] initWithManagerClass:[module class] bridge:self.bridge];
_componentDataByName[componentData.name] = componentData;
Expand Down

0 comments on commit d7865eb

Please sign in to comment.