From 3133a63cf82ac58f8731e8ff10865a516082aef0 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 29 Nov 2020 15:01:13 -0500 Subject: [PATCH] Fix crash when a preference doesn't have a title (e.g. info preference) --- .../tachiyomi/ui/setting/search/SettingsSearchHelper.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/search/SettingsSearchHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/search/SettingsSearchHelper.kt index ebcdd42cc4..a28c0bb191 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/search/SettingsSearchHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/search/SettingsSearchHelper.kt @@ -81,8 +81,8 @@ object SettingsSearchHelper { pref: Preference, breadcrumbs: String = "" ) { - when (pref) { - is PreferenceGroup -> { + when { + pref is PreferenceGroup -> { val breadcrumbsStr = addLocalizedBreadcrumb(breadcrumbs, "${pref.title}") for (x in 0 until pref.preferenceCount) { @@ -90,7 +90,7 @@ object SettingsSearchHelper { getSettingSearchResult(ctrl, subPref, breadcrumbsStr) // recursion } } - is PreferenceCategory -> { + pref is PreferenceCategory -> { val breadcrumbsStr = addLocalizedBreadcrumb(breadcrumbs, "${pref.title}") for (x in 0 until pref.preferenceCount) { @@ -98,7 +98,7 @@ object SettingsSearchHelper { getSettingSearchResult(ctrl, subPref, breadcrumbsStr) // recursion } } - else -> { + (pref.title != null) -> { // Is an actual preference val title = pref.title.toString() val summary = if (pref.summary != null) pref.summary.toString() else ""