Fixed image loading error

This commit is contained in:
Pupil
2020-02-22 09:30:24 +09:00
parent b967bf9a26
commit c0e7c87ca4
6 changed files with 14 additions and 16 deletions

View File

@@ -58,7 +58,7 @@ class ReaderAdapter(private val context: Context,
}
val modelProvider = object: ListPreloader.PreloadModelProvider<File> {
override fun getPreloadItems(position: Int): MutableList<File> {
return listOf(Cache(context).getImages(galleryID)?.get(position)).filterNotNullTo(mutableListOf())
return listOf(Cache(context).getImages(galleryID)?.getOrNull(position)).filterNotNullTo(mutableListOf())
}
override fun getPreloadRequestBuilder(item: File): RequestBuilder<*>? {