Added Error for Trying to Post Empty Comments

This commit is contained in:
hartator 2013-07-10 22:08:25 +02:00
parent 2fe94d611f
commit 21fce4c813

View file

@ -39,6 +39,10 @@ Meteor.methods({
if(!this.isSimulation && (timeSinceLastComment < commentInterval))
throw new Meteor.Error(704, 'Please wait '+(commentInterval-timeSinceLastComment)+' seconds before commenting again');
// Don't allow empty comments
if (!cleanText)
throw new Meteor.Error(704,'Your comment is empty.');
var comment = {
post: postId,
body: cleanText,