From 61b7e83316adc2e341fa80adbda6a6ba27f11ba0 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sat, 17 Sep 2016 20:10:43 +0200 Subject: catch all throwables when loading contacts --- .../java/de/pixart/messenger/ui/PublishProfilePictureActivity.java | 2 +- src/main/java/de/pixart/messenger/utils/PhoneHelper.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/de/pixart/messenger') diff --git a/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java b/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java index 187317f86..12e71720d 100644 --- a/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java +++ b/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java @@ -142,7 +142,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/de/pixart/messenger/utils/PhoneHelper.java b/src/main/java/de/pixart/messenger/utils/PhoneHelper.java index 7c19961b9..805b76673 100644 --- a/src/main/java/de/pixart/messenger/utils/PhoneHelper.java +++ b/src/main/java/de/pixart/messenger/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; -- cgit v1.2.3