From 039d73dde8cb30d01f8122616d8f74372da4e7e2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 16 Mar 2018 15:08:08 +0100 Subject: [PATCH] fixing a crash at checking image load fail reason --- .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 4554ee3eb..85c4212ef 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -255,7 +255,7 @@ class PhotoFragment : ViewPagerFragment() { .apply(options) .listener(object : RequestListener { override fun onLoadFailed(e: GlideException?, model: Any?, target: Target?, isFirstResource: Boolean): Boolean { - if (!useHalfResolution && e?.rootCauses?.first() is OutOfMemoryError) { + if (!useHalfResolution && e?.rootCauses?.firstOrNull() is OutOfMemoryError) { useHalfResolution = true Handler().post { loadBitmap(degrees)