diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp
index 8850952e8d13c197967c0ecbbb9f1e232ed3df28..cc6032effb12ef4da0aced0f4a4343eb1a31cfb5 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) {