From 95410097428e939f4ee38c7d4817f696acdb18cc Mon Sep 17 00:00:00 2001 From: Ibby Date: Tue, 10 Jan 2017 20:38:48 -0500 Subject: [PATCH] chore(): fix the callCordovaPlugin check the previous approach doesn't handle __proto__ methods --- src/plugins/plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/plugin.ts b/src/plugins/plugin.ts index 26c846372..9aeee810c 100644 --- a/src/plugins/plugin.ts +++ b/src/plugins/plugin.ts @@ -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);