Don't crash when list of chapters changes while binding
This commit is contained in:
parent
0172a5db13
commit
5429d858ef
|
@ -53,6 +53,10 @@ public class ChaptersListAdapter extends RecyclerView.Adapter<ChaptersListAdapte
|
|||
@Override
|
||||
public void onBindViewHolder(@NonNull ChapterHolder holder, int position) {
|
||||
Chapter sc = getItem(position);
|
||||
if (sc == null) {
|
||||
holder.title.setText("Error");
|
||||
return;
|
||||
}
|
||||
holder.title.setText(sc.getTitle());
|
||||
holder.start.setText(Converter.getDurationStringLong((int) sc
|
||||
.getStart()));
|
||||
|
|
Loading…
Reference in New Issue