Skip to content
Snippets Groups Projects
Commit f799c9ff authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

Better unknown command hadling in ProjectSyncHandler

parent 07dcdba1
Branches
No related tags found
No related merge requests found
......@@ -88,7 +88,11 @@ import scala.collection.{Map, mutable}
case json: JsonObject =>
val session = account.Session.getSession(key, sessionDao)
session match {
case Some(s) => listeners(json.get("cmd").getAsString).onChange(json, connection, s)
case Some(s) =>
val cmd = json.get("cmd").getAsString
if (listeners.contains(cmd)) {
listeners(cmd).onChange(json, connection, s)
}
case None => serverSession.close(500, "Invalid Session")
}
case _ => serverSession.close(500, "Invalid Data")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment