From 240f562f1f53bc4fd1046e0b448d338e33b12d87 Mon Sep 17 00:00:00 2001
From: Daniel Gerhardt <daniel.gerhardt@mni.thm.de>
Date: Sun, 25 May 2014 15:26:10 +0200
Subject: [PATCH] Add support to leave sessions via Socket.IO

---
 src/main/java/de/thm/arsnova/services/SessionService.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main/java/de/thm/arsnova/services/SessionService.java b/src/main/java/de/thm/arsnova/services/SessionService.java
index 0d63d14a8..07747a1c2 100644
--- a/src/main/java/de/thm/arsnova/services/SessionService.java
+++ b/src/main/java/de/thm/arsnova/services/SessionService.java
@@ -67,7 +67,9 @@ public class SessionService implements ISessionService {
 
 		Session session = databaseDao.getSession(keyword);
 		if (null == session) {
-			throw new NotFoundException();
+			userService.removeUserFromSessionBySocketId(socketId);
+
+			return null;
 		}
 		User user = userService.getUser2SocketId(socketId);
 
-- 
GitLab