From 950452579f1b0316816c4a67dc14df61867e3a5c Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 23 Apr 2020 03:24:01 -0400 Subject: [PATCH] Fixed rare crash when rotating screen in library --- .../java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt index 75bce8a219..22d8216c8c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt @@ -1,5 +1,6 @@ package eu.kanade.tachiyomi.ui.library +import android.app.Activity import android.view.Gravity import android.view.View import android.widget.FrameLayout @@ -78,6 +79,7 @@ class LibraryGridHolder( } private fun setCover(manga: Manga, id: Long) { + if ((adapter.recyclerView.context as? Activity)?.isDestroyed == true) return GlideApp.with(adapter.recyclerView.context).load(manga) .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC) .signature(ObjectKey(MangaImpl.getLastCoverFetch(id).toString()))