Fix potential NPE in native player

This commit is contained in:
Maxr1998
2021-02-07 21:30:02 +01:00
committed by Niels van Velzen
parent 174ac4d987
commit 07e4a2525d
@@ -81,13 +81,19 @@ class PlayerFragment : Fragment() {
/**
* Runnable that hides the unlock screen button, used by [peekUnlockButton]
*/
private val hideUnlockButtonAction = Runnable { unlockScreenButton.isVisible = false }
private val hideUnlockButtonAction = Runnable {
if (_playerBinding != null) {
unlockScreenButton.isVisible = false
}
}
/**
* Runnable that hides [playerView] controller
*/
private val hidePlayerViewControllerAction = Runnable {
playerView.hideController()
if (_playerBinding != null) {
playerView.hideController()
}
}
/**