chore(): fix the callCordovaPlugin check

the previous approach doesn't handle __proto__ methods
This commit is contained in:
Ibby 2017-01-10 20:38:48 -05:00
parent 9dee2fbc0c
commit 9541009742

View File

@ -108,7 +108,7 @@ function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts
let pluginInstance = getPlugin(pluginObj.pluginRef); 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). // Do this check in here in the case that the Web API for this plugin is available (for example, Geolocation).
if (!window.cordova) { if (!window.cordova) {
cordovaWarn(pluginObj.pluginName, methodName); cordovaWarn(pluginObj.pluginName, methodName);