mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 03:32:15 -05:00
catch all throwables when loading contacts
This commit is contained in:
parent
00c04cd413
commit
7bdd4166c0
@ -141,7 +141,7 @@ public class PublishProfilePictureActivity extends XmppActivity {
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.defaultUri = PhoneHelper.getSefliUri(getApplicationContext());
|
this.defaultUri = PhoneHelper.getSelfiUri(getApplicationContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void chooseAvatar(boolean crop) {
|
private void chooseAvatar(boolean crop) {
|
||||||
|
@ -93,14 +93,14 @@ public class PhoneHelper {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
return (super.loadInBackground());
|
return (super.loadInBackground());
|
||||||
} catch (SecurityException e) {
|
} catch (Throwable e) {
|
||||||
return(null);
|
return(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Uri getSefliUri(Context context) {
|
public static Uri getSelfiUri(Context context) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
|
||||||
&& context.checkSelfPermission(Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) {
|
&& context.checkSelfPermission(Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) {
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user