summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2012-02-23 10:42:17 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2012-02-23 10:42:17 +0100
commitd0094998c68419101d518e31135694bbba6a9a22 (patch)
treec1e11776a6585d56d6f32a920df3ec8fea806075 /server
parent2f951a372c5330b4e8a8209122905e073d189bda (diff)
Fix potential segfault
Diffstat (limited to 'server')
-rw-r--r--server/src/admin_connection.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/src/admin_connection.cc b/server/src/admin_connection.cc
index 5a15a34..f761023 100644
--- a/server/src/admin_connection.cc
+++ b/server/src/admin_connection.cc
@@ -66,8 +66,10 @@ static std::string admin_listactivesessions(Environment &env)
Session *s = NULL;
SessionAutounlock l(&s);
s = env.sessions.lockedSession(*i);
- str += "Session " + *i + ": "+s->templ+" on "+s->patientid+" "+
- std::string(s->idle()?"[idle]":"[active]")+"\n";
+ if(s) {
+ str += "Session " + *i + ": "+s->templ+" on "+s->patientid+" "+
+ std::string(s->idle()?"[idle]":"[active]")+"\n";
+ }
i++;
}