mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
parent
2c57bc965c
commit
54d1a9891b
@ -124,7 +124,15 @@ function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts
|
||||
}
|
||||
|
||||
// TODO: Illegal invocation needs window context
|
||||
return get(window, pluginObj.pluginRef)[methodName].apply(pluginInstance, args);
|
||||
let value;
|
||||
try {
|
||||
value = get(window, pluginObj.pluginRef)[methodName].apply(pluginInstance, args);
|
||||
} catch (e) {
|
||||
value = {
|
||||
error: 'cordova_not_available'
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user