fixing a crash at checking image load fail reason

This commit is contained in:
tibbi 2018-03-16 15:08:08 +01:00
parent 199a0a2407
commit 039d73dde8

View file

@ -255,7 +255,7 @@ class PhotoFragment : ViewPagerFragment() {
.apply(options) .apply(options)
.listener(object : RequestListener<Bitmap> { .listener(object : RequestListener<Bitmap> {
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap>?, isFirstResource: Boolean): Boolean { override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap>?, isFirstResource: Boolean): Boolean {
if (!useHalfResolution && e?.rootCauses?.first() is OutOfMemoryError) { if (!useHalfResolution && e?.rootCauses?.firstOrNull() is OutOfMemoryError) {
useHalfResolution = true useHalfResolution = true
Handler().post { Handler().post {
loadBitmap(degrees) loadBitmap(degrees)