Fix readmanga/mintmanga npe on chapter parse (#1876)

Fix readmanga/mintmanga npe on chapter parse
This commit is contained in:
Pavka 2019-12-15 02:55:09 +03:00 committed by arkon
parent 43b66fa0fe
commit 725a81257a
4 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Mintmanga' appName = 'Tachiyomi: Mintmanga'
pkgNameSuffix = 'ru.mintmanga' pkgNameSuffix = 'ru.mintmanga'
extClass = '.Mintmanga' extClass = '.Mintmanga'
extVersionCode = 14 extVersionCode = 15
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -151,7 +151,7 @@ class Mintmanga : ParsedHttpSource() {
} }
} }
val dots = chapter.name.indexOf("") val dots = chapter.name.indexOf("")
val numbers = chapter.name.findAnyOf(IntRange(0, 9).map { it.toString() })!!.first val numbers = chapter.name.findAnyOf(IntRange(0, 9).map { it.toString() })?.first ?: 0
if (dots in 0 until numbers) { if (dots in 0 until numbers) {
chapter.name = chapter.name.substringAfter("").trim() chapter.name = chapter.name.substringAfter("").trim()

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Readmanga' appName = 'Tachiyomi: Readmanga'
pkgNameSuffix = 'ru.readmanga' pkgNameSuffix = 'ru.readmanga'
extClass = '.Readmanga' extClass = '.Readmanga'
extVersionCode = 14 extVersionCode = 15
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -151,7 +151,7 @@ class Readmanga : ParsedHttpSource() {
} }
} }
val dots = chapter.name.indexOf("") val dots = chapter.name.indexOf("")
val numbers = chapter.name.findAnyOf(IntRange(0, 9).map { it.toString() })!!.first val numbers = chapter.name.findAnyOf(IntRange(0, 9).map { it.toString() })?.first ?: 0
if (dots in 0 until numbers) { if (dots in 0 until numbers) {
chapter.name = chapter.name.substringAfter("").trim() chapter.name = chapter.name.substringAfter("").trim()