Avoid rare crashes in settings search for ListPreferences

This commit is contained in:
arkon 2021-02-12 17:22:01 -05:00
parent 61e5440b7c
commit 3eda2a220a

View File

@ -101,7 +101,8 @@ object SettingsSearchHelper {
(pref.title != null && pref.isVisible) -> {
// Is an actual preference
val title = pref.title.toString()
val summary = pref.summary?.toString() ?: ""
// ListPreferences occasionally run into ArrayIndexOutOfBoundsException issues
val summary = try { pref.summary?.toString() ?: "" } catch (e: Throwable) { "" }
val breadcrumbsStr = addLocalizedBreadcrumb(breadcrumbs, "${pref.title}")
prefSearchResultList.add(