diff options
author | Tom Hennen <tom.hennen@gmail.com> | 2015-09-13 19:04:23 -0400 |
---|---|---|
committer | Tom Hennen <tom.hennen@gmail.com> | 2015-09-13 19:28:57 -0400 |
commit | 6612dbc836d3a43bdc10a2c0853b83662568b8f5 (patch) | |
tree | 3dba6640820581962725ab432c6c67bb6f3b04f3 /app/src/main | |
parent | 4e6abd997a045783a0582d1f939e8c3c1f60a0a6 (diff) | |
download | AntennaPod-6612dbc836d3a43bdc10a2c0853b83662568b8f5.zip |
prevent NPE when 'chapters' is null
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/adapter/ChapterListAdapter.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/ChapterListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/ChapterListAdapter.java index 67fb4c3b1..22c15949a 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/ChapterListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/ChapterListAdapter.java @@ -163,9 +163,11 @@ public class ChapterListAdapter extends ArrayAdapter<Chapter> { public int getCount() { // ignore invalid chapters int counter = 0; - for (Chapter chapter : chapters) { - if (!ignoreChapter(chapter)) { - counter++; + if (chapters != null) { + for (Chapter chapter : chapters) { + if (!ignoreChapter(chapter)) { + counter++; + } } } return counter; |