catch all throwables when loading contacts

This commit is contained in:
Daniel Gultsch 2016-09-17 11:31:35 +02:00
parent 00c04cd413
commit 7bdd4166c0
2 changed files with 3 additions and 3 deletions

View file

@ -141,7 +141,7 @@ public class PublishProfilePictureActivity extends XmppActivity {
}
});
this.defaultUri = PhoneHelper.getSefliUri(getApplicationContext());
this.defaultUri = PhoneHelper.getSelfiUri(getApplicationContext());
}
private void chooseAvatar(boolean crop) {

View file

@ -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;