mirror of
https://github.com/jellyfin/jellyfin-androidtv.git
synced 2024-11-30 09:30:54 +00:00
Fix crash when item doesn't have a default audio/subtitle stream
(cherry picked from commit 9577e11e41
)
This commit is contained in:
parent
7d84011d81
commit
389c48a1fd
@ -139,8 +139,8 @@ fun InfoRowSeasonEpisode(item: BaseItemDto) {
|
||||
|
||||
private fun List<MediaStream>.getDefault(type: MediaStreamType, defaultIndex: Int? = null): MediaStream? {
|
||||
if (defaultIndex != null) {
|
||||
val byIndex = get(defaultIndex)
|
||||
if (byIndex.type == type) return byIndex
|
||||
val byIndex = getOrNull(defaultIndex)
|
||||
if (byIndex?.type == type) return byIndex
|
||||
}
|
||||
|
||||
return firstOrNull { it.type == type }
|
||||
|
Loading…
Reference in New Issue
Block a user