[CB-3040] length is 1-based, but index is 0-based, can't use == in comparison

This commit is contained in:
Abel Muiño 2013-04-15 21:27:13 +02:00 committed by Andrew Grieve
parent 27cd9dde38
commit 2d4d18fd75

View File

@ -685,7 +685,7 @@ public class FileTransfer extends CordovaPlugin {
*/
private static String getArgument(JSONArray args, int position, String defaultString) {
String arg = defaultString;
if (args.length() >= position) {
if (args.length() > position) {
arg = args.optString(position);
if (arg == null || "null".equals(arg)) {
arg = defaultString;