aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com/juick')
-rw-r--r--juick-server/src/main/java/com/juick/server/WebsocketManager.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/juick-server/src/main/java/com/juick/server/WebsocketManager.java b/juick-server/src/main/java/com/juick/server/WebsocketManager.java
index a260817d1..0fa3c84c1 100644
--- a/juick-server/src/main/java/com/juick/server/WebsocketManager.java
+++ b/juick-server/src/main/java/com/juick/server/WebsocketManager.java
@@ -147,7 +147,9 @@ public class WebsocketManager extends TextWebSocketHandler {
if (c.visitor.getName().equals(serviceUser)) {
try {
Message draft = jsonMapper.readValue(message.asBytes(), Message.class);
- serverManager.processMessage(draft.getUser(), draft.getText(), draft.getAttachment().getUrl());
+ if (draft.getUser() != null && (draft.getText() != null || draft.getAttachment() != null)) {
+ serverManager.processMessage(draft.getUser(), draft.getText(), draft.getAttachment().getUrl());
+ }
} catch (IOException e) {
throw new HttpBadRequestException();
}