From ab9950ee7399e45a43d03e0712c6862ecf614600 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 5 Aug 2020 13:32:36 +0200 Subject: [PATCH] Fix crash reported by RageShake --- CHANGES.md | 1 + .../im/vector/app/features/login/LoginCaptchaFragment.kt | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 9bb0c2f8d0..387fcea73f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,7 @@ Improvements 🙌: Bugfix 🐛: - Fix invisible toolbar (Status.im theme) (#1746) - Fix relative date time formatting (#822) + - Fix crash reported by RageShake Translations 🗣: - Add PlayStore description resources in the Triple-T format, to let Weblate handle them diff --git a/vector/src/main/java/im/vector/app/features/login/LoginCaptchaFragment.kt b/vector/src/main/java/im/vector/app/features/login/LoginCaptchaFragment.kt index 5ae65d4fc7..fef8f441d6 100644 --- a/vector/src/main/java/im/vector/app/features/login/LoginCaptchaFragment.kt +++ b/vector/src/main/java/im/vector/app/features/login/LoginCaptchaFragment.kt @@ -77,6 +77,10 @@ class LoginCaptchaFragment @Inject constructor( override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) { super.onPageStarted(view, url, favicon) + if (!isAdded) { + return + } + // Show loader loginCaptchaProgress.isVisible = true } @@ -84,6 +88,10 @@ class LoginCaptchaFragment @Inject constructor( override fun onPageFinished(view: WebView, url: String) { super.onPageFinished(view, url) + if (!isAdded) { + return + } + // Hide loader loginCaptchaProgress.isVisible = false }