mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 08:20:32 +05:30
Merge pull request #6802 from FineFindus/fix/rotate-crash
fix: check if streams is initialized
This commit is contained in:
commit
a5162380ae
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user