From f9fd2094c9790b30f72075cada0453575ea09b59 Mon Sep 17 00:00:00 2001 From: "Notmoo-PC\\Notmoo" Date: Mon, 29 Jan 2018 23:27:15 +0100 Subject: [PATCH] =?UTF-8?q?[SERVEUR]=20Correction=20d'un=20bug=20critique?= =?UTF-8?q?=20levant=20une=20NPE=20si=20une=20requ=C3=AAte=20n'a=20pas=20d?= =?UTF-8?q?'utilisateur=20associ=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/pqt/server/servlets/QueryServlet.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Workspace/server/src/main/java/com/pqt/server/servlets/QueryServlet.java b/Workspace/server/src/main/java/com/pqt/server/servlets/QueryServlet.java index a880365f..81c8b087 100644 --- a/Workspace/server/src/main/java/com/pqt/server/servlets/QueryServlet.java +++ b/Workspace/server/src/main/java/com/pqt/server/servlets/QueryServlet.java @@ -66,7 +66,10 @@ public class QueryServlet extends HttpServlet { Message msg = messageToolFactory.getObjectParser(Message.class).parse(messageToHandle); - LOGGER.debug("Traitement du message (type : '{}', auteur : '{}')", msg.getType(), msg.getUser().getUsername()); + if(msg.getUser()!=null) + LOGGER.debug("Traitement du message (type : '{}', auteur : '{}')", msg.getType(), msg.getUser().getUsername()); + else + LOGGER.debug("Traitement du message (type : '{}', auteur : 'null')", msg.getType()); Message resp = msgHandler.handleMessage(msg);