aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/api
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-10-21 18:48:45 +0300
committerGravatar Vitaly Takmazov2018-10-21 18:48:45 +0300
commit2724726cacc605423b14e982afec744586dd08c4 (patch)
tree6d80562b47269cb2046791ad547e31ee4dcca4b1 /juick-server/src/main/java/com/juick/server/api
parent2a1e7e46568e285bef994799269ad1785e30fb25 (diff)
Throw on empty comment
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/api')
-rw-r--r--juick-server/src/main/java/com/juick/server/api/Post.java4
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);
}