diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt index 314051adc..1be7ce084 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt @@ -23,6 +23,7 @@ import io.legado.app.ui.widget.dialog.PhotoDialog import io.legado.app.utils.activity import io.legado.app.utils.getCompatColor import io.legado.app.utils.getPrefBoolean +import io.legado.app.utils.toastOnUi import kotlinx.coroutines.CoroutineScope import kotlin.math.min @@ -178,7 +179,11 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at val div = (lineBottom - lineTop - h) / 2 RectF(textChar.start, lineTop + div, textChar.end, lineBottom - div) } - canvas.drawBitmap(it, null, rectF, null) + kotlin.runCatching { + canvas.drawBitmap(it, null, rectF, null) + }.onFailure { e -> + context.toastOnUi(e.localizedMessage) + } } } }