Fixed crash due to nil call ID, fixed wrong @notnil tag in SDK

This commit is contained in:
Sylvain Berfini 2022-02-24 10:22:36 +01:00
parent d9e805d8d2
commit 84f0aceb61
2 changed files with 4 additions and 4 deletions

View file

@ -176,7 +176,7 @@ class TelecomConnectionService : ConnectionService() {
private fun onCallError(call: Call) {
val callId = call.callLog.callId
val connection = TelecomHelper.get().findConnectionForCallId(callId)
val connection = TelecomHelper.get().findConnectionForCallId(callId.orEmpty())
if (connection == null) {
Log.e("[Telecom Connection Service] Failed to find connection for call id: $callId")
return
@ -189,7 +189,7 @@ class TelecomConnectionService : ConnectionService() {
private fun onCallEnded(call: Call) {
val callId = call.callLog.callId
val connection = TelecomHelper.get().findConnectionForCallId(callId)
val connection = TelecomHelper.get().findConnectionForCallId(callId.orEmpty())
if (connection == null) {
Log.e("[Telecom Connection Service] Failed to find connection for call id: $callId")
return
@ -204,7 +204,7 @@ class TelecomConnectionService : ConnectionService() {
private fun onCallConnected(call: Call) {
val callId = call.callLog.callId
val connection = TelecomHelper.get().findConnectionForCallId(callId)
val connection = TelecomHelper.get().findConnectionForCallId(callId.orEmpty())
if (connection == null) {
Log.e("[Telecom Connection Service] Failed to find connection for call id: $callId")
return

View file

@ -104,7 +104,7 @@ class AudioRouteUtils {
val currentCall = call ?: coreContext.core.currentCall ?: coreContext.core.calls.firstOrNull()
if (currentCall != null && !skipTelecom && TelecomHelper.exists()) {
Log.i("[Audio Route Helper] Call provided & Telecom Helper exists, trying to dispatch audio route change through Telecom API")
val connection = TelecomHelper.get().findConnectionForCallId(currentCall.callLog.callId)
val connection = TelecomHelper.get().findConnectionForCallId(currentCall.callLog.callId.orEmpty())
if (connection != null) {
val route = when (types.first()) {
AudioDevice.Type.Earpiece -> CallAudioState.ROUTE_EARPIECE