diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-06-09 14:50:13 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-06-10 23:04:36 +0200 |
commit | 1c143e91f8c98ff3bd1af23a81e3b5f91946137d (patch) | |
tree | 7786e44d9e6b648ccd8e85871fc9e060b4a9eee4 /src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | |
parent | b2b3f20c172ba59953c56f62e9c3c815fd6b9485 (diff) |
catch conversations sort exception. not vital at this point
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services/XmppConnectionService.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index c2f1810a5..295798e50 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -1292,20 +1292,11 @@ public class XmppConnectionService extends Service { } } } - Collections.sort(list, new Comparator<Conversation>() { - @Override - public int compare(Conversation lhs, Conversation rhs) { - Message left = lhs.getLatestMessage(); - Message right = rhs.getLatestMessage(); - if (left.getTimeSent() > right.getTimeSent()) { - return -1; - } else if (left.getTimeSent() < right.getTimeSent()) { - return 1; - } else { - return 0; - } - } - }); + try { + Collections.sort(list); + } catch (IllegalArgumentException e) { + //ignore + } } public void loadMoreMessages(final Conversation conversation, final long timestamp, final OnMoreMessagesLoaded callback) { |