Fix bug in message model

conversation.changedAttributes returns false when there are no changes.
This commit is contained in:
lilia 2015-08-02 10:10:43 -07:00
parent 3e73f8f0ba
commit 98a14e9a6a

View file

@ -154,7 +154,7 @@
avatar : dataMessage.group.avatar,
members : dataMessage.group.members,
};
group_update = conversation.changedAttributes(_.pick(dataMessage.group, 'name', 'avatar'));
group_update = conversation.changedAttributes(_.pick(dataMessage.group, 'name', 'avatar')) || {};
var difference = _.difference(dataMessage.group.members, conversation.get('members'));
if (difference.length > 0) {
group_update.joined = difference;