Skip to content
This repository has been archived by the owner on May 16, 2019. It is now read-only.

Commit

Permalink
Check for empty "last_status" before sorting DM column (mastodon#9207)
Browse files Browse the repository at this point in the history
* Check for empty "last_status" before sorting

* Small touchups for codeclimate
  • Loading branch information
sammy8806 authored and Gargron committed Nov 23, 2018
1 parent ba06a5f commit 449e6e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/javascript/mastodon/reducers/conversations.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ const expandNormalizedConversations = (state, conversations, next) => {

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;
});
});
}

Expand Down

0 comments on commit 449e6e4

Please sign in to comment.