Skip to content

Commit

Permalink
chore(): fix the callCordovaPlugin check
Browse files Browse the repository at this point in the history
the previous approach doesn't handle __proto__ methods
  • Loading branch information
ihadeed committed Jan 11, 2017
1 parent 9dee2fb commit 9541009
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9541009

Please sign in to comment.