diff options
author | ByteHamster <info@bytehamster.com> | 2021-03-07 20:03:45 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2021-03-07 20:03:45 +0100 |
commit | 5429d858efcd69f598cc053cc28503a3e65833f7 (patch) | |
tree | 34be3f49e0f4de8f1408f8b265d9382242e58e88 | |
parent | 0172a5db13ff53e509e077f18b756aea618dc3b1 (diff) | |
download | AntennaPod-5429d858efcd69f598cc053cc28503a3e65833f7.zip |
Don't crash when list of chapters changes while binding
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java index d4b32ee06..8380d8626 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java @@ -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())); |