Prevent crash

pull/214/head
M66B 1 year ago
parent 85055acaad
commit e5977be956

@ -4327,11 +4327,24 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
}
private TupleMessageEx getMessage() {
try {
int pos = getAdapterPosition();
if (pos == RecyclerView.NO_POSITION)
return null;
return differ.getItem(pos);
} catch (Throwable ex) {
/*
Exception java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at androidx.paging.PagedList.loadAround (PagedList.java:424)
at androidx.paging.AsyncPagedListDiffer.getItem (AsyncPagedListDiffer.java:216)
at eu.faircode.email.AdapterMessage$ViewHolder.getMessage (AdapterMessage.java:4334)
at eu.faircode.email.AdapterMessage$ViewHolder.onKeyPressed (AdapterMessage.java:4746)
at eu.faircode.email.FragmentMessages$131.onKeyPressed (FragmentMessages.java:8253)
*/
Log.e(ex);
return null;
}
}
@Override

Loading…
Cancel
Save