aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-04-28 22:23:45 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-04-28 22:23:45 +0200
commit6a15bc26b6310c5b0915e7511fba4dfa5eb2cae2 (patch)
treef76935d50d2c46eb8dbe5e677855aa31efffacf9
parentd94c231a744900ca7a1297ffd0980536591d61f5 (diff)
npe check after reading image uri
-rw-r--r--src/main/java/eu/siacs/conversations/persistance/FileBackend.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
index 9ae56b048..e120adbd1 100644
--- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
+++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
@@ -400,7 +400,9 @@ public class FileBackend {
options.inSampleSize = calcSampleSize(image,Math.max(newHeight, newWidth));
is = mXmppConnectionService.getContentResolver().openInputStream(image);
Bitmap source = BitmapFactory.decodeStream(is, null, options);
-
+ if (source == null) {
+ return null;
+ }
int sourceWidth = source.getWidth();
int sourceHeight = source.getHeight();
float xScale = (float) newWidth / sourceWidth;
@@ -418,8 +420,6 @@ public class FileBackend {
return dest;
} catch (FileNotFoundException e) {
return null;
- } catch (IOException e) {
- return null;
} finally {
close(is);
}