diff --git a/app/src/main/java/io/legado/app/api/controller/BookController.kt b/app/src/main/java/io/legado/app/api/controller/BookController.kt index c7b8e0ae5..659dc2078 100644 --- a/app/src/main/java/io/legado/app/api/controller/BookController.kt +++ b/app/src/main/java/io/legado/app/api/controller/BookController.kt @@ -1,5 +1,6 @@ package io.legado.app.api.controller +import androidx.core.graphics.drawable.toBitmap import io.legado.app.R import io.legado.app.api.ReturnData import io.legado.app.constant.PreferKey @@ -43,11 +44,12 @@ object BookController { fun getCover(parameters: Map>): ReturnData { val returnData = ReturnData() val coverPath = parameters["path"]?.firstOrNull() - val ftBitmap = ImageLoader.loadBitmap(appCtx, coverPath) - .placeholder(CoverImageView.defaultDrawable) - .error(CoverImageView.defaultDrawable) - .submit() - return returnData.setData(ftBitmap.get()) + val ftBitmap = ImageLoader.loadBitmap(appCtx, coverPath).submit() + return try { + returnData.setData(ftBitmap.get()) + } catch (e: Exception) { + returnData.setData(CoverImageView.defaultDrawable.toBitmap()) + } } /**