mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-03-25 15:40:08 +01:00
catch and show exceptions thrown at changing contact photo
This commit is contained in:
parent
52f7846867
commit
7220062283
@ -293,7 +293,12 @@ class EditContactActivity : ContactActivity() {
|
||||
var bitmap = MediaStore.Images.Media.getBitmap(contentResolver, primaryUri)
|
||||
if (bitmap == null) {
|
||||
imageUri = backupUri
|
||||
bitmap = MediaStore.Images.Media.getBitmap(contentResolver, backupUri) ?: return
|
||||
try {
|
||||
bitmap = MediaStore.Images.Media.getBitmap(contentResolver, backupUri) ?: return
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
return
|
||||
}
|
||||
|
||||
// we might have received an URI which we have no permission to send further, so just copy the received image in a new uri (for example from Google Photos)
|
||||
val newFile = getCachePhoto()
|
||||
|
Loading…
x
Reference in New Issue
Block a user