From bee4b0ff7256aa98d58ffb731ab5154fd7c96ac2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 9 Mar 2019 23:30:02 +0100 Subject: [PATCH] adding a few more checks at activity state at loading fullscreen images --- .../simplemobiletools/gallery/pro/fragments/PhotoFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt index 4a4754c94..6cad0ebcc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt @@ -373,7 +373,7 @@ class PhotoFragment : ViewPagerFragment() { .apply(options) .listener(object : RequestListener { override fun onLoadFailed(e: GlideException?, model: Any?, target: Target?, isFirstResource: Boolean): Boolean { - if (activity != null) { + if (activity != null && !activity!!.isDestroyed && !activity!!.isFinishing) { tryLoadingWithPicasso(addZoomableView) } return false