diff --git a/js/models/conversations.js b/js/models/conversations.js index cfe30a81..34128936 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -39,6 +39,10 @@ var missing = _.filter(required, function(attr) { return !attributes[attr]; }); if (missing.length) { return "Conversation must have " + missing; } + if (attributes.type !== 'private' && attributes.type !== 'group') { + return "Invalid conversation type: " + attributes.type; + } + // hack if (this.get('type') === 'private') { this.id = libphonenumber.util.verifyNumber(this.id);