Merge pull request #1269 from TomHennen/fix1225

prevent NPE when 'chapters' is null
This commit is contained in:
Tom Hennen 2015-10-17 12:27:57 -04:00
commit cad49943d8
1 changed files with 5 additions and 3 deletions

View File

@ -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;