mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
catch a weird exception at getting ongoing call handle
This commit is contained in:
@ -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
|
||||||
|
@ -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
|
||||||
|
Reference in New Issue
Block a user