mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-24 02:12:15 -05:00
Merge pull request #266 from m0vie/npe-fix
message view / list: fix NPE when list is empty
This commit is contained in:
commit
3379fdb573
@ -2903,11 +2903,11 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
|
||||
}
|
||||
|
||||
public boolean isFirst(MessageReference messageReference) {
|
||||
return messageReference.equals(getReferenceForPosition(0));
|
||||
return mAdapter.isEmpty() || messageReference.equals(getReferenceForPosition(0));
|
||||
}
|
||||
|
||||
public boolean isLast(MessageReference messageReference) {
|
||||
return messageReference.equals(getReferenceForPosition(mAdapter.getCount() - 1));
|
||||
return mAdapter.isEmpty() || messageReference.equals(getReferenceForPosition(mAdapter.getCount() - 1));
|
||||
}
|
||||
|
||||
private MessageReference getReferenceForPosition(int position) {
|
||||
|
Loading…
Reference in New Issue
Block a user