From d5447c62f7d52f339967563e919b3bfd210b3019 Mon Sep 17 00:00:00 2001 From: Mohammad Reza Moradi Date: Wed, 15 Nov 2023 08:49:35 +0100 Subject: [PATCH] fix: hangup on call crash --- lib/src/voip/call.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/voip/call.dart b/lib/src/voip/call.dart index 5bf2a42f..e71cc42c 100644 --- a/lib/src/voip/call.dart +++ b/lib/src/voip/call.dart @@ -1200,7 +1200,9 @@ class CallSession { setCallState(CallState.kEnded); if (!isGroupCall) { - if (callId != voip.currentCID) return; + // when a call crash and this call is already terminated the currentCId is null. + // So don't return bc the hangup or reject will not proceed anymore. + if (callId != voip.currentCID && voip.currentCID != null) return; voip.currentCID = null; voip.incomingCallRoomId.removeWhere((key, value) => value == callId); }