fix: fix the fix for the fix for MangaUpdates

null is better than a crash
This commit is contained in:
rebelonion 2024-04-05 21:21:33 -05:00
parent 04538c52f2
commit 58d5b5bc41
2 changed files with 3 additions and 3 deletions

View file

@ -43,9 +43,9 @@ class MangaUpdates {
}
companion object {
fun getLatestChapter(results: MangaUpdatesResponse.Results): Int {
fun getLatestChapter(results: MangaUpdatesResponse.Results): Int? {
return results.metadata.series.latestChapter
?: results.record.chapter!!.substringAfterLast("-").trim().toInt()
?: results.record.chapter!!.substringAfterLast("-").trim().toIntOrNull()
}
}