From c1bc2a2c7e5c4c40ae84984bd9094ee1f1e272cf Mon Sep 17 00:00:00 2001 From: Liviu Timar <65943217+liviu-timar@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:21:07 +0200 Subject: [PATCH] Invoke onError when not null (#1243) --- .../video/android/ui/common/StreamCallActivity.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/stream-video-android-ui-core/src/main/kotlin/io/getstream/video/android/ui/common/StreamCallActivity.kt b/stream-video-android-ui-core/src/main/kotlin/io/getstream/video/android/ui/common/StreamCallActivity.kt index 59f3274605..4fb1084682 100644 --- a/stream-video-android-ui-core/src/main/kotlin/io/getstream/video/android/ui/common/StreamCallActivity.kt +++ b/stream-video-android-ui-core/src/main/kotlin/io/getstream/video/android/ui/common/StreamCallActivity.kt @@ -779,11 +779,13 @@ public abstract class StreamCallActivity : ComponentActivity() { if (cid == null) { val e = IllegalArgumentException("CallActivity started without call ID.") - logger.e( - e, - ) { "Failed to initialize call because call ID is not found in the intent. $intent" } - onError?.let { - } ?: throw e + + logger.e(e) { + "Failed to initialize call because call ID is not found in the intent. $intent" + } + + onError?.invoke(e) ?: throw e + // Finish return }