diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-09-17 14:02:28 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-09-17 14:02:28 +0200 |
commit | 07c7f5bc086de3f99396a773371e76cbbb2901e0 (patch) | |
tree | cdbbcdff102c26621519f36ccf5d2c54f80a03b6 | |
parent | 7e712d9d4cdd7fb8aa6c7ef68ce2d5c39ff1c257 (diff) |
catch IndexOutOfBoundsException when swiping away conversations
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationActivity.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 913190b4..48045a64 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -210,7 +210,11 @@ public class ConversationActivity extends XmppActivity View v = listView.getChildAt(0); final int top = (v == null) ? 0 : (v.getTop() - listView.getPaddingTop()); - swipedConversation = listAdapter.getItem(position); + try { + swipedConversation = listAdapter.getItem(position); + } catch (IndexOutOfBoundsException e) { + return null; + } listAdapter.remove(swipedConversation); swipedConversation.markRead(); xmppConnectionService.getNotificationService().clear(swipedConversation); |