From d292f71a8373fc4388d2db57252620306671165f Mon Sep 17 00:00:00 2001 From: Bnyro Date: Fri, 21 Jun 2024 16:57:02 +0200 Subject: [PATCH] fix: crash when entering audio mode via pip --- .../java/com/github/libretube/ui/fragments/PlayerFragment.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt index aea578df8..e8fd389dc 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt @@ -688,9 +688,11 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { @SuppressLint("SourceLockedOrientationActivity") fun unsetFullscreen() { + if (activity == null || _binding == null) return + viewModel.isFullscreen.value = false - if (!PlayerHelper.autoFullscreenEnabled && activity != null) { + if (!PlayerHelper.autoFullscreenEnabled) { mainActivity.requestedOrientation = mainActivity.screenOrientationPref }