From d0094998c68419101d518e31135694bbba6a9a22 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 23 Feb 2012 10:42:17 +0100 Subject: Fix potential segfault --- server/src/admin_connection.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'server/src') 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++; } -- cgit v1.2.3