From dddb962d9e16cf2231804cfe7843cda600c9c19b Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sat, 3 Jun 2023 21:48:28 +0200 Subject: [PATCH] Fix crash when long pressing share while loading --- .../java/com/github/libretube/ui/fragments/PlayerFragment.kt | 3 ++- 1 file changed, 2 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 4b22a91af..c27101c4d 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 @@ -448,7 +448,8 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { } binding.relPlayerShare.setOnLongClickListener { - streams.hls ?: return@setOnLongClickListener true + if (!this::streams.isInitialized || streams.hls == null) + return@setOnLongClickListener true // start an intent with video as mimetype using the hls stream val uri = Uri.parse(ProxyHelper.unwrapIfEnabled(streams.hls!!))