From 8a16e950784ea0145d1993982d5b0de4998ce040 Mon Sep 17 00:00:00 2001
From: Hugo Lefeuvre <hugo.lefeuvre@savoirfairelinux.com>
Date: Mon, 27 Aug 2018 16:44:52 -0400
Subject: [PATCH] manager: better handle answer call failure

If call->answer() fails then we should not continue further
(switchCall or addAudio doesn't make sense in the case of an invalid
call).

Change-Id: Ib68a7960cbb8a7b604d0f68136a6e0d538a22b8c
---
 src/manager.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/manager.cpp b/src/manager.cpp
index 552e00a8c0..072195c370 100644
--- a/src/manager.cpp
+++ b/src/manager.cpp
@@ -929,6 +929,11 @@ Manager::answerCall(const std::string& call_id)
     // if it was waiting, it's waiting no more
     pimpl_->removeWaitingCall(call_id);
 
+    if (!result) {
+        // do not switch to this call if it was not properly started
+        return false;
+    }
+
     // if we dragged this call into a conference already
     if (isConferenceParticipant(call_id))
         pimpl_->switchCall(call->getConfId());
-- 
GitLab