[Android] Prevent an IllegalStateException crash in the remote access onboarding

Nicolas Pomepuy git at videolan.org
Thu Oct 17 13:38:14 UTC 2024


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Oct 17 11:57:50 2024 +0200| [c19292f62df067bdf8fe95a363d70b1796d67d41] | committer: Duncan McNamara

Prevent an IllegalStateException crash in the remote access onboarding

> https://code.videolan.org/videolan/vlc-android/commit/c19292f62df067bdf8fe95a363d70b1796d67d41
---

 .../onboarding/RemoteAccessOnboardingContentFragment.kt          | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/application/webserver/src/main/java/org/videolan/vlc/webserver/gui/remoteaccess/onboarding/RemoteAccessOnboardingContentFragment.kt b/application/webserver/src/main/java/org/videolan/vlc/webserver/gui/remoteaccess/onboarding/RemoteAccessOnboardingContentFragment.kt
index be87f0ede7..78b459489c 100644
--- a/application/webserver/src/main/java/org/videolan/vlc/webserver/gui/remoteaccess/onboarding/RemoteAccessOnboardingContentFragment.kt
+++ b/application/webserver/src/main/java/org/videolan/vlc/webserver/gui/remoteaccess/onboarding/RemoteAccessOnboardingContentFragment.kt
@@ -64,9 +64,12 @@ class RemoteAccessOnboardingContentFragment : RemoteAccessOnboardingFragment() {
         animationLoop.playSequentially(appearingSets.toMutableList() as List<Animator>?)
         animationLoop.doOnEnd {
             lifecycleScope.launch {
-                viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) {
-                    delay(2000)
-                    animationLoop.start()
+                try {
+                    viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) {
+                        delay(2000)
+                        animationLoop.start()
+                    }
+                } catch (_: IllegalStateException) {
                 }
             }
         }



More information about the Android mailing list