diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java index a8e6fc4..fbe8470 100644 --- a/src/android/CameraLauncher.java +++ b/src/android/CameraLauncher.java @@ -943,7 +943,12 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect try { fileStream = FileHelper.getInputStreamFromUriString(imageUrl, cordova); image = BitmapFactory.decodeStream(fileStream); - } finally { + } catch (OutOfMemoryError e) { + callbackContext.error(e.getLocalizedMessage()); + } catch (Exception e){ + callbackContext.error(e.getLocalizedMessage()); + } + finally { if (fileStream != null) { try { fileStream.close();