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) {
|
fun Context.addBlockedNumber(number: String) {
|
||||||
ContentValues().apply {
|
ContentValues().apply {
|
||||||
put(BlockedNumbers.COLUMN_ORIGINAL_NUMBER, number)
|
put(BlockedNumbers.COLUMN_ORIGINAL_NUMBER, number)
|
||||||
|
try {
|
||||||
contentResolver.insert(BlockedNumbers.CONTENT_URI, this)
|
contentResolver.insert(BlockedNumbers.CONTENT_URI, this)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
showErrorToast(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue