summaryrefslogtreecommitdiff
path: root/server/src/session.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/session.cc')
-rw-r--r--server/src/session.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/src/session.cc b/server/src/session.cc
index 7290c31..530efac 100644
--- a/server/src/session.cc
+++ b/server/src/session.cc
@@ -182,9 +182,9 @@ Session *Sessions::newSession(std::string patientid, std::string templ)
while(i != sessions.end()) {
if(i->second->patientid == patientid &&
i->second->templ == templ) {
- Session *s = i->second;
- if(s->active()) throw SessionAlreadyActive(s->id());
- return s;
+ Session *session = i->second;
+ if(session->active()) throw SessionAlreadyActive(session->id());
+ return session;
}
i++;
@@ -195,6 +195,7 @@ Session *Sessions::newSession(std::string patientid, std::string templ)
Session *session = ser.findFromTupple(patientid, templ);
if(session) {
sessions[session->id()] = session;
+ if(session->active()) throw SessionAlreadyActive(session->id());
return session;
}
}