Merge branch 'master' into add-manage-tabs

This commit is contained in:
Tibor Kaputa
2021-11-19 10:40:07 +01:00
committed by GitHub
52 changed files with 509 additions and 623 deletions

View File

@ -55,13 +55,12 @@ class CallManager {
fun getCallContact(context: Context, callback: (CallContact?) -> Unit) {
ensureBackgroundThread {
val callContact = CallContact("", "", "")
if (call == null || call?.details == null || call?.details?.handle == null) {
callback(callContact)
return@ensureBackgroundThread
val handle = try {
call?.details?.handle?.toString()
} catch (e: NullPointerException) {
null
}
// something here can be null even after the previous check, so do it like this
val handle = call?.details?.handle?.toString()
if (handle == null) {
callback(callContact)
return@ensureBackgroundThread