catch IndexOutOfBoundsException when swiping away conversations
This commit is contained in:
parent
7e712d9d4c
commit
07c7f5bc08
|
@ -210,7 +210,11 @@ public class ConversationActivity extends XmppActivity
|
||||||
View v = listView.getChildAt(0);
|
View v = listView.getChildAt(0);
|
||||||
final int top = (v == null) ? 0 : (v.getTop() - listView.getPaddingTop());
|
final int top = (v == null) ? 0 : (v.getTop() - listView.getPaddingTop());
|
||||||
|
|
||||||
|
try {
|
||||||
swipedConversation = listAdapter.getItem(position);
|
swipedConversation = listAdapter.getItem(position);
|
||||||
|
} catch (IndexOutOfBoundsException e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
listAdapter.remove(swipedConversation);
|
listAdapter.remove(swipedConversation);
|
||||||
swipedConversation.markRead();
|
swipedConversation.markRead();
|
||||||
xmppConnectionService.getNotificationService().clear(swipedConversation);
|
xmppConnectionService.getNotificationService().clear(swipedConversation);
|
||||||
|
|
Loading…
Reference in New Issue