Browse Source

Prevent crash

main
M66B 6 years ago
parent
commit
f602a6d687
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      app/src/main/java/eu/faircode/email/ItemKeyProviderMessage.java

+ 5
- 1
app/src/main/java/eu/faircode/email/ItemKeyProviderMessage.java View File

@ -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…
Cancel
Save