fix crash if media is not found in tmdb

This commit is contained in:
Jannik 2021-08-15 00:11:42 +02:00
parent d76538cf28
commit a505315781
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ class TMDBApiController {
it.asJsonObject.get("title")?.asString
}
return@withContext sortedResults.first().asJsonObject?.get("id")?.asInt ?: -1
return@withContext sortedResults.firstOrNull()?.asJsonObject?.get("id")?.asInt ?: -1
}
@Suppress("BlockingMethodInNonBlockingContext")