mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-01-31 17:44:46 +01:00
catch exceptions thrown at fetching new thread IDs
This commit is contained in:
parent
9641eed138
commit
05c84e498c
@ -500,7 +500,11 @@ fun Context.markMessageRead(id: Int, isMMS: Boolean) {
|
||||
@SuppressLint("NewApi")
|
||||
fun Context.getThreadId(address: String): Long {
|
||||
return if (isMarshmallowPlus()) {
|
||||
Threads.getOrCreateThreadId(this, address)
|
||||
try {
|
||||
Threads.getOrCreateThreadId(this, address)
|
||||
} catch (e: Exception) {
|
||||
0
|
||||
}
|
||||
} else {
|
||||
0
|
||||
}
|
||||
@ -509,7 +513,11 @@ fun Context.getThreadId(address: String): Long {
|
||||
@SuppressLint("NewApi")
|
||||
fun Context.getThreadId(addresses: Set<String>): Long {
|
||||
return if (isMarshmallowPlus()) {
|
||||
Threads.getOrCreateThreadId(this, addresses)
|
||||
try {
|
||||
Threads.getOrCreateThreadId(this, addresses)
|
||||
} catch (e: Exception) {
|
||||
0
|
||||
}
|
||||
} else {
|
||||
0
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user