diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-08-19 12:25:17 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-08-19 12:25:17 +0200 |
commit | 6e1870b00acf565bb92bcb14b9c9ee8e71020bb4 (patch) | |
tree | fa821ecd525a5814c129fd02a7dc39104471aea3 /src/main | |
parent | 9ebd6d503cc6e80383e441171d06730fce52bd9d (diff) |
check if inputstream is null before cropping avatar images
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/persistance/FileBackend.java | 6 |
1 files changed, 6 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 f18266d9..00637257 100644 --- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java @@ -385,6 +385,9 @@ public class FileBackend { BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = calcSampleSize(image, size); is = mXmppConnectionService.getContentResolver().openInputStream(image); + if (is == null) { + return null; + } Bitmap input = BitmapFactory.decodeStream(is, null, options); if (input == null) { return null; @@ -411,6 +414,9 @@ public class FileBackend { BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = calcSampleSize(image,Math.max(newHeight, newWidth)); is = mXmppConnectionService.getContentResolver().openInputStream(image); + if (is == null) { + return null; + } Bitmap source = BitmapFactory.decodeStream(is, null, options); if (source == null) { return null; |