diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderPageImageView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderPageImageView.kt index 7fe5ec98ec76..c0f0a3fecc0f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderPageImageView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderPageImageView.kt @@ -122,21 +122,22 @@ open class ReaderPageImageView @JvmOverloads constructor( } private fun SubsamplingScaleImageView.landscapeZoom(forward: Boolean) { + val config = config if (config != null && - config!!.landscapeZoom && - config!!.minimumScaleType == SCALE_TYPE_CENTER_INSIDE && + config.landscapeZoom && + config.minimumScaleType == SCALE_TYPE_CENTER_INSIDE && sWidth > sHeight && scale == minScale ) { handler?.postDelayed(500) { - val point = when (config!!.zoomStartPosition) { + val point = when (config.zoomStartPosition) { ZoomStartPosition.LEFT -> if (forward) PointF(0F, 0F) else PointF(sWidth.toFloat(), 0F) ZoomStartPosition.RIGHT -> if (forward) PointF(sWidth.toFloat(), 0F) else PointF(0F, 0F) ZoomStartPosition.CENTER -> center } val targetScale = height.toFloat() / sHeight.toFloat() - animateScaleAndCenter(targetScale, point)!! + (animateScaleAndCenter(targetScale, point) ?: return@postDelayed) .withDuration(500) .withEasing(EASE_IN_OUT_QUAD) .withInterruptible(true)