From 7a7efa73cd7b8f347e7949e6fd87a714a86e1503 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Wed, 10 May 2023 19:48:09 +0200 Subject: [PATCH] Fix crash when closing player due to view bindings --- .../java/com/github/libretube/ui/fragments/PlayerFragment.kt | 2 +- 1 file changed, 1 insertion(+), 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 3aa12eef1..15a1a19a3 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 @@ -1128,7 +1128,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { */ @SuppressLint("SetTextI18n") private fun updateDisplayedDuration() { - if (exoPlayer.duration < 0 || streams.livestream) return + if (exoPlayer.duration < 0 || streams.livestream || _binding == null) return playerBinding.duration.text = DateUtils.formatElapsedTime( exoPlayer.duration.div(1000),