mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-26 05:15:49 +08:00
[ReactNative] Check if bridge is valid on -modules
This commit is contained in:
@@ -1081,6 +1081,10 @@ RCT_INNER_BRIDGE_ONLY(_invokeAndProcessModule:(NSString *)module method:(NSStrin
|
||||
|
||||
- (NSDictionary *)modules
|
||||
{
|
||||
if (!self.isValid) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
RCTAssert(_modulesByName != nil, @"Bridge modules have not yet been initialized. "
|
||||
"You may be trying to access a module too early in the startup procedure.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user