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() {
|
public int getCount() {
|
||||||
// ignore invalid chapters
|
// ignore invalid chapters
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
for (Chapter chapter : chapters) {
|
if (chapters != null) {
|
||||||
if (!ignoreChapter(chapter)) {
|
for (Chapter chapter : chapters) {
|
||||||
counter++;
|
if (!ignoreChapter(chapter)) {
|
||||||
|
counter++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return counter;
|
return counter;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user