diff options
author | 2018-10-21 18:48:45 +0300 | |
---|---|---|
committer | 2018-10-21 18:48:45 +0300 | |
commit | 2724726cacc605423b14e982afec744586dd08c4 (patch) | |
tree | 6d80562b47269cb2046791ad547e31ee4dcca4b1 | |
parent | 2a1e7e46568e285bef994799269ad1785e30fb25 (diff) |
Throw on empty comment
-rw-r--r-- | juick-server/src/main/java/com/juick/server/api/Post.java | 4 |
1 files changed, 4 insertions, 0 deletions
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); } |