From 8ff2540f4bca8fe0b5edcd145575be2d9ccc21f4 Mon Sep 17 00:00:00 2001 From: Cloudburst <18114966+C10udburst@users.noreply.github.com> Date: Tue, 23 Aug 2022 17:13:35 +0200 Subject: [PATCH] fix #43 (again) --- .../lagradost/cloudstream3/ui/settings/SettingsLang.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsLang.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsLang.kt index 1c77f1d8..b038f21a 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsLang.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsLang.kt @@ -101,9 +101,11 @@ class SettingsLang : PreferenceFragmentCompat() { val names = enumValues().sorted().map { it.name } val default = enumValues().sorted().filter { it != TvType.NSFW }.map { it.ordinal } val defaultSet = default.map { it.toString() }.toSet() - val currentList = settingsManager.getStringSet(getString(R.string.prefer_media_type_key), defaultSet)?.map { - it.toInt() - } ?: default + val currentList = try { + settingsManager.getStringSet(getString(R.string.prefer_media_type_key), defaultSet)?.map { + it.toInt() + } + } catch (e: Throwable) { null } ?: default activity?.showMultiDialog( names,