mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-02-11 09:00:52 +01:00
catch and show exceptions thrown at adding blocked numbers
This commit is contained in:
parent
4236414aa2
commit
2c1218870d
@ -332,7 +332,11 @@ fun Context.getBlockedNumbers(): ArrayList<BlockedNumber> {
|
||||
fun Context.addBlockedNumber(number: String) {
|
||||
ContentValues().apply {
|
||||
put(BlockedNumbers.COLUMN_ORIGINAL_NUMBER, number)
|
||||
contentResolver.insert(BlockedNumbers.CONTENT_URI, this)
|
||||
try {
|
||||
contentResolver.insert(BlockedNumbers.CONTENT_URI, this)
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user