Add another guard to lazilyLoadView

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
This commit is contained in:
Mehdi Mulani 2018-11-09 11:22:38 -08:00 committed by Facebook Github Bot
parent fba7c1ece2
commit d7865ebde8

View File

@ -1530,6 +1530,10 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(lazilyLoadView:(NSString *)name)
// 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;