From 58a3182518870d419905c51f37787503ca2615f1 Mon Sep 17 00:00:00 2001
From: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
Date: Tue, 11 Oct 2011 12:05:53 -0400
Subject: [PATCH] * #7126: fix segfault when recording conference

---
 daemon/src/managerimpl.cpp | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp
index 8850952e8d..cc6032effb 100644
--- a/daemon/src/managerimpl.cpp
+++ b/daemon/src/managerimpl.cpp
@@ -2065,13 +2065,16 @@ void ManagerImpl::setRecordingCall (const std::string& id)
     } else {
         _debug ("Manager: Set recording for conference %s", id.c_str());
         ConferenceMap::const_iterator it(_conferencemap.find(id));
-        Conference *conf = it->second;
-        if (rec->isRecording())
-        	conf->setState(Conference::ACTIVE_ATTACHED);
-        else
-        	conf->setState(Conference::ACTIVE_ATTACHED_REC);
-
-        rec = conf;
+        if (it != _conferencemap.end()) {
+            Conference *conf = it->second;
+            if (conf) {
+                rec = conf;
+                if (rec->isRecording())
+                    conf->setState(Conference::ACTIVE_ATTACHED);
+                else
+                    conf->setState(Conference::ACTIVE_ATTACHED_REC);
+            }
+        }
     }
 
     if (rec == NULL) {
-- 
GitLab