mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
chore(): fix the callCordovaPlugin check
the previous approach doesn't handle __proto__ methods
This commit is contained in:
parent
9dee2fbc0c
commit
9541009742
@ -108,7 +108,7 @@ function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts
|
||||
|
||||
let pluginInstance = getPlugin(pluginObj.pluginRef);
|
||||
|
||||
if (!pluginInstance || !pluginInstance.hasOwnProperty(methodName)) {
|
||||
if (!pluginInstance || pluginInstance[methodName] === 'undefined') {
|
||||
// Do this check in here in the case that the Web API for this plugin is available (for example, Geolocation).
|
||||
if (!window.cordova) {
|
||||
cordovaWarn(pluginObj.pluginName, methodName);
|
||||
|
Loading…
Reference in New Issue
Block a user