catch a weird exception at getting ongoing call handle

This commit is contained in:
tibbi
2021-11-18 20:47:46 +01:00
parent e302696782
commit 8518db9e3c
2 changed files with 7 additions and 2 deletions

View File

@ -55,7 +55,12 @@ class CallManager {
fun getCallContact(context: Context, callback: (CallContact?) -> Unit) {
ensureBackgroundThread {
val callContact = CallContact("", "", "")
val handle = call?.details?.handle?.toString()
val handle = try {
call?.details?.handle?.toString()
} catch (e: NullPointerException) {
null
}
if (handle == null) {
callback(callContact)
return@ensureBackgroundThread