mirror of https://github.com/M66B/FairEmail.git
Prevent crash
This commit is contained in:
parent
16e0b366b3
commit
f602a6d687
|
@ -18,7 +18,11 @@ public class ItemKeyProviderMessage extends ItemKeyProvider<Long> {
|
|||
@Override
|
||||
public Long getKey(int pos) {
|
||||
AdapterMessage adapter = (AdapterMessage) recyclerView.getAdapter();
|
||||
return adapter.getCurrentList().get(pos).id;
|
||||
PagedList<TupleMessageEx> list = adapter.getCurrentList();
|
||||
if (list != null && pos < list.size())
|
||||
return list.get(pos).id;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue