If for some reason a group has no name, provide a default

This commit is contained in:
lilia 2014-10-17 13:14:09 -07:00
parent 0036e4ef74
commit 0bd5f3e3c2

View file

@ -7,6 +7,7 @@ var Whisper = Whisper || {};
var Thread = Backbone.Model.extend({ var Thread = Backbone.Model.extend({
defaults: function() { defaults: function() {
return { return {
name: 'New Group',
image: '/images/default.png', image: '/images/default.png',
unreadCount: 0, unreadCount: 0,
timestamp: new Date().getTime(), timestamp: new Date().getTime(),
@ -97,7 +98,7 @@ var Whisper = Whisper || {};
if (decrypted.message.group) { if (decrypted.message.group) {
attributes = { attributes = {
groupId : decrypted.message.group.id, groupId : decrypted.message.group.id,
name : decrypted.message.group.name, name : decrypted.message.group.name || 'New group',
type : 'group', type : 'group',
}; };
} else { } else {