diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-08-25 11:11:53 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-08-25 11:11:53 +0200 |
commit | 7617a19280d7d7c6d716ce366419db5993cc3254 (patch) | |
tree | 6f1bd713d8ad67a8835852285a7a3600d6586366 /src/main/java/eu | |
parent | 476db24c10180c0100bbd9a2cfbc34b672464b74 (diff) |
additonal null checks in file backend
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/persistance/FileBackend.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java index 9381ba1d..628f5630 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; |