fix wp mangastream no chapter issue (#5118)

when there is no chapter, ext throw "index 0 size 0 instead"
This commit is contained in:
Riztard Lanthorn 2020-12-13 22:31:12 +07:00 committed by GitHub
parent d6ce9abd26
commit 6ae811f8a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'WP MangaStream (multiple sources)'
pkgNameSuffix = 'all.wpmangastream'
extClass = '.WPMangaStreamFactory'
extVersionCode = 39
extVersionCode = 40
libVersion = '1.2'
}

View File

@ -190,7 +190,8 @@ abstract class WPMangaStream(
// Add timestamp to latest chapter, taken from "Updated On". so source which not provide chapter timestamp will have atleast one
val date = document.select(".fmed:contains(update) time ,span:contains(update) time").attr("datetime")
if (date != "") chapters[0].date_upload = parseDate(date)
val checkChapter = document.select(chapterListSelector()).firstOrNull()
if (date != "" && checkChapter != null) chapters[0].date_upload = parseDate(date)
return chapters
}