diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt index b1d18b8f..464d10ac 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt @@ -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 diff --git a/build.gradle b/build.gradle index e38e072d..6129fadb 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { jcenter() } 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" // NOTE: Do not place your application dependencies here; they belong