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…
Reference in New Issue