Skip to content
Snippets Groups Projects
Commit 575b9053 authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Fix NPE

Check user object against null before accepting feedback via Websocket.
parent 34be2757
Branches
Tags
No related merge requests found
......@@ -156,6 +156,11 @@ public class ARSnovaSocketIOServer implements ARSnovaSocket, NovaEventVisitor {
@Override
public void onData(final SocketIOClient client, final Feedback data, final AckRequest ackSender) {
final User u = userService.getUser2SocketId(client.getSessionId());
if (u == null) {
LOGGER.info("Client {} tried to send feedback but is not mapped to a user", client.getSessionId());
return;
}
final String sessionKey = userService.getSessionForUser(u.getUsername());
LOGGER.debug("Feedback recieved: {}", new Object[] {u, sessionKey, data.getValue()});
if (null != sessionKey) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment