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) { fun getCallContact(context: Context, callback: (CallContact?) -> Unit) {
ensureBackgroundThread { ensureBackgroundThread {
val callContact = CallContact("", "", "") val callContact = CallContact("", "", "")
val handle = call?.details?.handle?.toString() val handle = try {
call?.details?.handle?.toString()
} catch (e: NullPointerException) {
null
}
if (handle == null) { if (handle == null) {
callback(callContact) callback(callContact)
return@ensureBackgroundThread return@ensureBackgroundThread

View File

@ -7,7 +7,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.0.2' classpath 'com.android.tools.build:gradle:7.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong