mangadex no chapter fix added another null check (#367)

This commit is contained in:
Carlos 2018-06-20 07:56:41 -04:00 committed by GitHub
parent f6143e226b
commit 4f160a2dfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -5,8 +5,8 @@ ext {
appName = 'Tachiyomi: MangaDex' appName = 'Tachiyomi: MangaDex'
pkgNameSuffix = "all.mangadex" pkgNameSuffix = "all.mangadex"
extClass = '.MangadexFactory' extClass = '.MangadexFactory'
extVersionCode = 29 extVersionCode = 30
extVersionSuffix = 29 extVersionSuffix = 30
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -231,9 +231,7 @@ open class Mangadex(override val lang: String, private val internalLang: String,
manga.author = mangaJson.get("author").string manga.author = mangaJson.get("author").string
manga.artist = mangaJson.get("artist").string manga.artist = mangaJson.get("artist").string
val finalChapterNumber = getFinalChapter(mangaJson) val finalChapterNumber = getFinalChapter(mangaJson)
val chapterJson = json.getAsJsonObject("chapter") if (json.getAsJsonObject("chapter") != null && isMangaCompleted(finalChapterNumber, json.getAsJsonObject("chapter"))) {
if (isMangaCompleted(finalChapterNumber, chapterJson)) {
manga.status = SManga.COMPLETED manga.status = SManga.COMPLETED
} else { } else {
manga.status = parseStatus(mangaJson.get("status").int) manga.status = parseStatus(mangaJson.get("status").int)