From 7bdd4166c02a88b1e5249056fabcf0e1833ab555 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 17 Sep 2016 11:31:35 +0200 Subject: [PATCH] catch all throwables when loading contacts --- .../siacs/conversations/ui/PublishProfilePictureActivity.java | 2 +- src/main/java/eu/siacs/conversations/utils/PhoneHelper.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java b/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java index 0752ae321..f18013c4f 100644 --- a/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/PublishProfilePictureActivity.java @@ -141,7 +141,7 @@ public class PublishProfilePictureActivity extends XmppActivity { } }); - this.defaultUri = PhoneHelper.getSefliUri(getApplicationContext()); + this.defaultUri = PhoneHelper.getSelfiUri(getApplicationContext()); } private void chooseAvatar(boolean crop) { diff --git a/src/main/java/eu/siacs/conversations/utils/PhoneHelper.java b/src/main/java/eu/siacs/conversations/utils/PhoneHelper.java index e3a24fcfa..3242cfcf5 100644 --- a/src/main/java/eu/siacs/conversations/utils/PhoneHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/PhoneHelper.java @@ -93,14 +93,14 @@ public class PhoneHelper { try { return (super.loadInBackground()); - } catch (SecurityException e) { + } catch (Throwable e) { return(null); } } } - public static Uri getSefliUri(Context context) { + public static Uri getSelfiUri(Context context) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && context.checkSelfPermission(Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) { return null;