Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1D7DD10885 for ; Wed, 4 Sep 2013 18:34:22 +0000 (UTC) Received: (qmail 39549 invoked by uid 500); 4 Sep 2013 18:34:21 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 39433 invoked by uid 500); 4 Sep 2013 18:34:21 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 39418 invoked by uid 99); 4 Sep 2013 18:34:20 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Sep 2013 18:34:20 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 65C83900567; Wed, 4 Sep 2013 18:34:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bowserj@apache.org To: commits@cordova.apache.org Date: Wed, 04 Sep 2013 18:34:21 -0000 Message-Id: <08853be64d23461e92733c78db3e8c50@git.apache.org> In-Reply-To: <53381bf7ac00415d984449a3acfec6ea@git.apache.org> References: <53381bf7ac00415d984449a3acfec6ea@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] git commit: No longer causes a stack trace, but it doesn't cause the error to be called. No longer causes a stack trace, but it doesn't cause the error to be called. Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/118ca18d Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/118ca18d Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/118ca18d Branch: refs/heads/dev Commit: 118ca18d5a7d77dfe37c5c9a85350a7890448de9 Parents: 382e942 Author: Joe Bowser Authored: Wed Aug 21 15:39:43 2013 -0700 Committer: Joe Bowser Committed: Wed Sep 4 11:34:13 2013 -0700 ---------------------------------------------------------------------- src/android/CameraLauncher.java | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/118ca18d/src/android/CameraLauncher.java ---------------------------------------------------------------------- diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java index ba432cb..02a9211 100755 --- a/src/android/CameraLauncher.java +++ b/src/android/CameraLauncher.java @@ -76,7 +76,7 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect private static final String GET_PICTURE = "Get Picture"; private static final String GET_VIDEO = "Get Video"; private static final String GET_All = "Get All"; - + private static final String LOG_TAG = "CameraLauncher"; private int mQuality; // Compression quality hint (0-100: 0=low quality & high compression, 100=compress of max quality) @@ -153,15 +153,26 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect this.targetHeight = -1; } - if (srcType == CAMERA) { - this.takePicture(destType, encodingType); + try { + if (srcType == CAMERA) { + this.takePicture(destType, encodingType); + } + else if ((srcType == PHOTOLIBRARY) || (srcType == SAVEDPHOTOALBUM)) { + this.getImage(srcType, destType); + } } - else if ((srcType == PHOTOLIBRARY) || (srcType == SAVEDPHOTOALBUM)) { - this.getImage(srcType, destType); + catch (IllegalArgumentException e) + { + 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); r.setKeepCallback(true); callbackContext.sendPluginResult(r); + return true; } return false;