From 43626143a77869fc9b0b20328440a9644ab61852 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Tue, 21 Mar 2023 19:48:01 +0100 Subject: [PATCH] Fix crash when unregistering downloads receiver --- .../java/com/github/libretube/ui/fragments/DownloadsFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/libretube/ui/fragments/DownloadsFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/DownloadsFragment.kt index f5f889fc1..61d133fe8 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/DownloadsFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/DownloadsFragment.kt @@ -181,7 +181,7 @@ class DownloadsFragment : Fragment() { override fun onStop() { super.onStop() - if (serviceConnection.isBound) { + runCatching { context?.unbindService(serviceConnection) } }