From 2724726cacc605423b14e982afec744586dd08c4 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 21 Oct 2018 18:48:45 +0300 Subject: Throw on empty comment --- juick-server/src/main/java/com/juick/server/api/Post.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'juick-server/src/main/java') diff --git a/juick-server/src/main/java/com/juick/server/api/Post.java b/juick-server/src/main/java/com/juick/server/api/Post.java index 74a29de7..303ff109 100644 --- a/juick-server/src/main/java/com/juick/server/api/Post.java +++ b/juick-server/src/main/java/com/juick/server/api/Post.java @@ -150,6 +150,10 @@ public class Post { throw new HttpBadRequestException(); } } + if (StringUtils.isBlank(body) && StringUtils.isBlank(attachmentFName.toString())) { + // Should be there for compatibility + throw new HttpBadRequestException(); + } return commandsManager.processCommand(visitor, String.format("#%d/%d %s", mid, rid, body), attachmentFName); } -- cgit v1.2.3