Prevent crash

pull/146/head
M66B 6 years ago
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…
Cancel
Save