From 7617a19280d7d7c6d716ce366419db5993cc3254 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 25 Aug 2015 11:11:53 +0200 Subject: [PATCH] additonal null checks in file backend --- .../java/eu/siacs/conversations/persistance/FileBackend.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java index 9381ba1d8..628f56303 100644 --- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java @@ -137,6 +137,9 @@ public class FileBackend { options.inJustDecodeBounds = true; try { BitmapFactory.decodeStream(mXmppConnectionService.getContentResolver().openInputStream(uri), null, options); + if (options == null || options.outMimeType == null) { + return false; + } return (options.outWidth <= Config.IMAGE_SIZE && options.outHeight <= Config.IMAGE_SIZE && options.outMimeType.contains(Config.IMAGE_FORMAT.name().toLowerCase())); } catch (FileNotFoundException e) { return false;