mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
Merge branch 'master' into add-manage-tabs
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user