fix: hangup on call crash

This commit is contained in:
Mohammad Reza Moradi 2023-11-15 08:49:35 +01:00
parent 7bcd5840e1
commit d5447c62f7
No known key found for this signature in database
GPG Key ID: FE7CA223893CEFA1
1 changed files with 3 additions and 1 deletions

View File

@ -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);
}