prevent NPE when 'chapters' is null
This commit is contained in:
parent
88050cff9f
commit
79f0eca912
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue