Skip to content
Snippets Groups Projects
Commit 280fb243 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Geoffrey Métais
Browse files

Fix NPE when moviepedia date is null

parent dc30c647
No related branches found
No related tags found
1 merge request!347Fix NPE when moviepedia date is null
Pipeline #11616 passed with stage
in 4 minutes and 24 seconds
......@@ -128,7 +128,8 @@ fun MediaMetadataWithImages.tvshowSubtitle(): String {
fun MediaMetadataWithImages.tvEpisodeSubtitle(): String {
return when (metadata.type) {
MediaMetadataType.TV_EPISODE -> "S${metadata.season.toString().padStart(2, '0')}E${metadata.episode.toString().padStart(2, '0')}"
else -> SimpleDateFormat("yyyy", Locale.getDefault()).format(metadata.releaseDate)
else -> metadata.releaseDate?.let { SimpleDateFormat("yyyy", Locale.getDefault()).format(metadata.releaseDate) }
?: ""
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment