Skip to content

Commit

Permalink
Fix crash when item doesn't have a default audio/subtitle stream
Browse files Browse the repository at this point in the history
(cherry picked from commit 9577e11)
  • Loading branch information
nielsvanvelzen committed Aug 12, 2024
1 parent 7d84011 commit 389c48a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 389c48a

Please sign in to comment.