diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-04-28 22:23:45 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-04-28 22:23:45 +0200 |
commit | 6a15bc26b6310c5b0915e7511fba4dfa5eb2cae2 (patch) | |
tree | f76935d50d2c46eb8dbe5e677855aa31efffacf9 | |
parent | d94c231a744900ca7a1297ffd0980536591d61f5 (diff) |
npe check after reading image uri
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/persistance/FileBackend.java | 6 |
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 9ae56b04..e120adbd 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); } |