From: Alexis Laferrière Date: Wed, 11 Nov 2015 15:58:47 +0000 (-0500) Subject: contrib/tnitter: do not allow posting empty tnits X-Git-Tag: v0.8~88^2~10 X-Git-Url: http://nitlanguage.org contrib/tnitter: do not allow posting empty tnits Signed-off-by: Alexis Laferrière --- diff --git a/contrib/tnitter/src/action.nit b/contrib/tnitter/src/action.nit index 21418fa..261e842 100644 --- a/contrib/tnitter/src/action.nit +++ b/contrib/tnitter/src/action.nit @@ -135,9 +135,9 @@ class Tnitter session = null else if turi == "/post" and request.post_args.keys.has("text") and session != null then var user = session.user - if user != null then + var text = request.post_args["text"].trim + if user != null and not text.is_empty then # Post a Tnit! - var text = request.post_args["text"] db.post(user, text) db.close