diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-08-19 12:29:23 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-08-19 12:29:23 +0200 |
commit | dafcee6a5bff1ed1938329a8b3d4555d893e8fff (patch) | |
tree | 2205992c597566048c8f9023cb59c7b6e2bfc566 | |
parent | 9edcca1045126ecbaf4818c4e48881e06cbbd657 (diff) | |
parent | 6e1870b00acf565bb92bcb14b9c9ee8e71020bb4 (diff) |
Merge branch 'master' into development
-rw-r--r-- | src/main/java/eu/siacs/conversations/persistance/FileBackend.java | 6 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/utils/PhoneHelper.java | 2 |
2 files changed, 7 insertions, 1 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; diff --git a/src/main/java/eu/siacs/conversations/utils/PhoneHelper.java b/src/main/java/eu/siacs/conversations/utils/PhoneHelper.java index b90f06ff..a37f60a0 100644 --- a/src/main/java/eu/siacs/conversations/utils/PhoneHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/PhoneHelper.java @@ -97,7 +97,7 @@ public class PhoneHelper { if (packageName != null) { try { return context.getPackageManager().getPackageInfo(packageName, 0).versionName; - } catch (final PackageManager.NameNotFoundException e) { + } catch (final PackageManager.NameNotFoundException | RuntimeException e) { return "unknown"; } } else { |