From f0f3afd5f16b0a95c0080ef6bb7695ef490fd3e9 Mon Sep 17 00:00:00 2001 From: jmir1 <43830312+jmir1@users.noreply.github.com> Date: Mon, 11 Oct 2021 19:51:20 +0200 Subject: [PATCH] Fix issues with NSFW sources setting (#6085) --- .../ui/setting/SettingsBrowseController.kt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBrowseController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBrowseController.kt index 08d82cb008..0ce909d815 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBrowseController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBrowseController.kt @@ -12,6 +12,7 @@ import eu.kanade.tachiyomi.util.preference.requireAuthentication import eu.kanade.tachiyomi.util.preference.summaryRes import eu.kanade.tachiyomi.util.preference.switchPreference import eu.kanade.tachiyomi.util.preference.titleRes +import eu.kanade.tachiyomi.util.system.AuthenticatorUtil.isAuthenticationSupported import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys class SettingsBrowseController : SettingsController() { @@ -54,11 +55,13 @@ class SettingsBrowseController : SettingsController() { summaryRes = R.string.requires_app_restart defaultValue = true - requireAuthentication( - activity as? FragmentActivity, - activity!!.getString(R.string.pref_category_nsfw_content), - activity!!.getString(R.string.confirm_lock_change), - ) + if (context.isAuthenticationSupported() && activity != null) { + requireAuthentication( + activity as? FragmentActivity, + activity!!.getString(R.string.pref_category_nsfw_content), + activity!!.getString(R.string.confirm_lock_change), + ) + } } infoPreference(R.string.parental_controls_info)