iOS:fix when DoricContext is nil
This commit is contained in:
parent
229fc41de3
commit
2821d42ebd
@ -34,6 +34,9 @@ @implementation DoricBridgeExtension
|
|||||||
|
|
||||||
- (id)callNativeWithContextId:(NSString *)contextId module:(NSString *)module method:(NSString *)method callbackId:(NSString *)callbackId argument:(id)argument {
|
- (id)callNativeWithContextId:(NSString *)contextId module:(NSString *)module method:(NSString *)method callbackId:(NSString *)callbackId argument:(id)argument {
|
||||||
__strong DoricContext *context = [[DoricContextManager instance] getContext:contextId];
|
__strong DoricContext *context = [[DoricContextManager instance] getContext:contextId];
|
||||||
|
if (!context) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
DoricRegistry *registry = context.driver.registry;
|
DoricRegistry *registry = context.driver.registry;
|
||||||
Class pluginClass = [registry acquireNativePlugin:module];
|
Class pluginClass = [registry acquireNativePlugin:module];
|
||||||
DoricNativePlugin *nativePlugin = context.pluginInstanceMap[module];
|
DoricNativePlugin *nativePlugin = context.pluginInstanceMap[module];
|
||||||
|
Reference in New Issue
Block a user