X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FCore.java;h=37c026f8dd0999053f12bd01ec6d2148998ea070;hp=4761959fc4e00019fd138d022400df7e08237e1d;hb=536ff0d46064e9e3a197cd41060e6660c696ac67;hpb=fe5abf5090baa28cac73b34f2a56bf488ed73a64 diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 4761959..37c026f 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -1579,6 +1579,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis * @return The created post */ public Post createPost(Sone sone, Sone recipient, long time, String text) { + Validation.begin().isNotNull("Text", text).check().isGreater("Text Length", text.length(), 0).check(); if (!isLocalSone(sone)) { logger.log(Level.FINE, String.format("Tried to create post for non-local Sone: %s", sone)); return null; @@ -1719,6 +1720,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis * @return The created reply */ public PostReply createReply(Sone sone, Post post, long time, String text) { + Validation.begin().isNotNull("Text", text).check().isGreater("Text Length", text.trim().length(), 0).check(); if (!isLocalSone(sone)) { logger.log(Level.FINE, String.format("Tried to create reply for non-local Sone: %s", sone)); return null;