CB-13415 (android) Importing corrupt images using the Camera plugin c… (#309)

* CB-13415 (android) Importing corrupt images using the Camera plugin crashes the app
This commit is contained in:
Alpesh Patel 2018-02-08 17:42:16 +05:30 committed by jcesarmobile
parent ad8788a5e6
commit bf935dfbd2

View File

@ -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();