Merge pull request #6802 from FineFindus/fix/rotate-crash

fix: check if streams is initialized
This commit is contained in:
Bnyro 2024-11-20 21:24:58 +01:00 committed by GitHub
commit a5162380ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -141,11 +141,11 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
private lateinit var streams: Streams private lateinit var streams: Streams
val isShort val isShort
get() = run { get() = run {
val heightGreaterThanWidth = streams.videoStreams.firstOrNull()?.let { val heightGreaterThanWidth = ::streams.isInitialized && streams.videoStreams.firstOrNull()?.let {
(it.height ?: 0) > (it.width ?: 0) (it.height ?: 0) > (it.width ?: 0)
} } == true
PlayingQueue.getCurrent()?.isShort == true || heightGreaterThanWidth == true PlayingQueue.getCurrent()?.isShort == true || heightGreaterThanWidth
} }
// if null, it's been set to automatic // if null, it's been set to automatic