X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FCore.java;h=5843b30191d17ff6a4a724ecf58b3ff679ca17c3;hp=34083837bf30bffd220958f577284e2bf1d055d0;hb=adc8230792298a693a8f9ba01a6db04753d15b47;hpb=4a0c67e05ac11c36484cbea260a5c94a7e63175f diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 3408383..5843b30 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -1580,6 +1580,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; @@ -1720,6 +1721,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;