From 9d7eae252e937cb6b2b59f9275c7951c7a8c731f Mon Sep 17 00:00:00 2001 From: cketti Date: Tue, 2 Apr 2013 02:26:01 +0200 Subject: [PATCH] Avoid NullPointerException --- src/com/fsck/k9/fragment/MessageListFragment.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/fsck/k9/fragment/MessageListFragment.java b/src/com/fsck/k9/fragment/MessageListFragment.java index 2a0c67b9c..142c82d6f 100644 --- a/src/com/fsck/k9/fragment/MessageListFragment.java +++ b/src/com/fsck/k9/fragment/MessageListFragment.java @@ -3041,7 +3041,10 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick long uniqueId = cursor.getLong(mUniqueIdColumn); if (mSelected.contains(uniqueId)) { - messages.add(getMessageAtPosition(position)); + Message message = getMessageAtPosition(position); + if (message != null) { + messages.add(message); + } } }