Check for empty "last_status" before sorting DM column (#9207)

* Check for empty "last_status" before sorting

* Small touchups for codeclimate
th-downstream
Steven Tappert 6 years ago committed by Eugen Rochko
parent bd31e76dcf
commit 6cd08a266a

@ -56,7 +56,13 @@ const expandNormalizedConversations = (state, conversations, next) => {
list = list.concat(items); list = list.concat(items);
return list.sortBy(x => x.get('last_status'), (a, b) => compareId(a, b) * -1); return list.sortBy(x => x.get('last_status'), (a, b) => {
if(a === null || b === null) {
return -1;
}
return compareId(a, b) * -1;
});
}); });
} }

Loading…
Cancel
Save