Merge pull request #1202 from TomHennen/chapter_npe

Resolves NullPointerException when dealing with chapters
This commit is contained in:
Tom Hennen 2015-09-13 20:10:03 -04:00
commit 7af9b9a0df
2 changed files with 7 additions and 5 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.danoeh.antennapod" package="de.danoeh.antennapod"
android:versionCode="1030400" android:versionCode="1030401"
android:versionName="1.3.4.0"> android:versionName="1.3.4.1">
<!-- <!--
Version code schema: Version code schema:
"1.2.3-SNAPSHOT" -> 1020300 "1.2.3-SNAPSHOT" -> 1020300

View File

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