correct broken pm draft

This commit is contained in:
Sam 2013-05-30 08:55:23 +10:00
parent 3dfb9f0c2f
commit 4e2c6f43d1
1 changed files with 5 additions and 1 deletions

View File

@ -169,7 +169,11 @@ Discourse.Composer = Discourse.Model.extend({
this.get('titleLength') > Discourse.SiteSettings.max_topic_title_length) ) return true;
// Need at least one user when sending a private message
if (this.get('creatingPrivateMessage') && (this.get('targetUsernames').trim() + ',').indexOf(',') === 0) return true;
if ( this.get('creatingPrivateMessage') &&
this.get('targetUsernames') &&
(this.get('targetUsernames').trim() + ',').indexOf(',') === 0) {
return true;
}
// reply is always required
if (this.get('replyLength') < Discourse.SiteSettings.min_post_length) return true;