From 09c07faafd30c096d8a06aac46715a0261b6c151 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 15 May 2021 15:29:21 -0400 Subject: [PATCH] Avoid invalid reading mode/orientation selections Related to #5068 --- .../tachiyomi/ui/reader/setting/ReaderReadingModeSettings.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderReadingModeSettings.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderReadingModeSettings.kt index 58b35ddcb..2889e41bb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderReadingModeSettings.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderReadingModeSettings.kt @@ -53,13 +53,13 @@ class ReaderReadingModeSettings @JvmOverloads constructor(context: Context, attr initPagerPreferences() } } - binding.viewer.setSelection((context as ReaderActivity).presenter.manga?.readingModeType.let { ReadingModeType.fromPreference(it).prefValue }) + binding.viewer.setSelection((context as ReaderActivity).presenter.manga?.readingModeType?.let { ReadingModeType.fromPreference(it).prefValue } ?: ReadingModeType.DEFAULT.prefValue) binding.rotationMode.onItemSelectedListener = { position -> val rotationType = OrientationType.fromSpinner(position) (context as ReaderActivity).presenter.setMangaOrientationType(rotationType.flagValue) } - binding.rotationMode.setSelection((context as ReaderActivity).presenter.manga?.orientationType.let { OrientationType.fromPreference(it).prefValue }) + binding.rotationMode.setSelection((context as ReaderActivity).presenter.manga?.orientationType?.let { OrientationType.fromPreference(it).prefValue } ?: OrientationType.DEFAULT.prefValue) } /**