Merge branch 'master' into dev

This commit is contained in:
Andrew Grieve 2013-09-06 00:15:45 -04:00
commit 763e6f0e9a

View File

@ -153,15 +153,26 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
this.targetHeight = -1; this.targetHeight = -1;
} }
if (srcType == CAMERA) { try {
this.takePicture(destType, encodingType); if (srcType == CAMERA) {
this.takePicture(destType, encodingType);
}
else if ((srcType == PHOTOLIBRARY) || (srcType == SAVEDPHOTOALBUM)) {
this.getImage(srcType, destType);
}
} }
else if ((srcType == PHOTOLIBRARY) || (srcType == SAVEDPHOTOALBUM)) { catch (IllegalArgumentException e)
this.getImage(srcType, destType); {
callbackContext.error("Illegal Argument Exception");
PluginResult r = new PluginResult(PluginResult.Status.ERROR);
callbackContext.sendPluginResult(r);
return true;
} }
PluginResult r = new PluginResult(PluginResult.Status.NO_RESULT); PluginResult r = new PluginResult(PluginResult.Status.NO_RESULT);
r.setKeepCallback(true); r.setKeepCallback(true);
callbackContext.sendPluginResult(r); callbackContext.sendPluginResult(r);
return true; return true;
} }
return false; return false;