[Fix] NullException thrown at line 286. Fix missing element for year text

This commit is contained in:
Jace 2022-08-29 17:08:53 +08:00 committed by Cloudburst
parent f6a0010d31
commit ebf31e9fe8
2 changed files with 4 additions and 3 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 1 version = 2
cloudstream { cloudstream {

View file

@ -283,8 +283,9 @@ class TenshiProvider : MainAPI() {
?.trim() ?.trim()
val pattern = Regex("(\\d{4})") val pattern = Regex("(\\d{4})")
val yearText = document.selectFirst("li.release-date .value")!!.text() document.selectFirst("li.release-date .value")?.text()?.let {
year = pattern.find(yearText)?.groupValues?.get(1)?.toIntOrNull() year = pattern.find(it)?.groupValues?.get(1)?.toIntOrNull()
}
addEpisodes(DubStatus.Subbed, episodes) addEpisodes(DubStatus.Subbed, episodes)