CB-11880 android: Fail-safe for cordova.exec()

- added preliminary sanity check on args variable
- replication of iosExec() behaviour
- allows to call cordova.exec() without args variable

This closes #334
This commit is contained in:
Thomas Raffray 2016-09-21 11:06:01 +02:00 committed by Joe Bowser
parent b2d7124424
commit f838db4e18

View File

@ -78,6 +78,9 @@ function androidExec(success, fail, service, action, args) {
androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT);
}
// If args is not provided, default to an empty array
args = args || [];
// Process any ArrayBuffers in the args into a string.
for (var i = 0; i < args.length; i++) {
if (utils.typeName(args[i]) == 'ArrayBuffer') {