diff options
Diffstat (limited to 'main/src/ui/java')
3 files changed, 6 insertions, 4 deletions
diff --git a/main/src/ui/java/de/blinkt/openvpn/fragments/GeneralSettings.kt b/main/src/ui/java/de/blinkt/openvpn/fragments/GeneralSettings.kt index 24734eb1..0842925d 100644 --- a/main/src/ui/java/de/blinkt/openvpn/fragments/GeneralSettings.kt +++ b/main/src/ui/java/de/blinkt/openvpn/fragments/GeneralSettings.kt @@ -50,9 +50,11 @@ class GeneralSettings : PreferenceFragmentCompat(), Preference.OnPreferenceClick devHacks.removePreference(useInternalFS) } - /* Android P does not allow access to the file storage anymore */if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) { + /* Android P does not allow access to the file storage anymore */ + if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) { val useInternalFileSelector = findPreference<Preference>("useInternalFileSelector") - devHacks.removePreference(useInternalFileSelector) + if (useInternalFileSelector != null) + devHacks.removePreference(useInternalFileSelector) } mExtapp = ExternalAppDatabase(activity) val clearapi = findPreference<Preference>("clearapi") as Preference diff --git a/main/src/ui/java/de/blinkt/openvpn/fragments/Settings_Authentication.kt b/main/src/ui/java/de/blinkt/openvpn/fragments/Settings_Authentication.kt index aa5ec7ab..51a4e2e3 100644 --- a/main/src/ui/java/de/blinkt/openvpn/fragments/Settings_Authentication.kt +++ b/main/src/ui/java/de/blinkt/openvpn/fragments/Settings_Authentication.kt @@ -54,7 +54,7 @@ class Settings_Authentication : OpenVpnPreferencesFragment(), Preference.OnPrefe setRemoteCNSummaryProvider() mRemoteX509Name = findPreference("remotex509name")!! mRemoteX509Name.setSummaryProvider { pref -> - if ((pref as EditTextPreference).text.isEmpty()) "CN (default)" else pref.text + if ((pref as EditTextPreference).text?.isEmpty() == true) "CN (default)" else pref.text } mUseTLSAuth = findPreference("useTLSAuth")!! mTLSAuthFile = findPreference("tlsAuthFile")!! diff --git a/main/src/ui/java/de/blinkt/openvpn/fragments/Settings_IP.kt b/main/src/ui/java/de/blinkt/openvpn/fragments/Settings_IP.kt index ada77836..27e6854f 100644 --- a/main/src/ui/java/de/blinkt/openvpn/fragments/Settings_IP.kt +++ b/main/src/ui/java/de/blinkt/openvpn/fragments/Settings_IP.kt @@ -111,7 +111,7 @@ class Settings_IP : OpenVpnPreferencesFragment(), Preference.OnPreferenceChangeL } class DNSSummaryProvider : Preference.SummaryProvider<Preference> { - override fun provideSummary(preference: Preference?): CharSequence { + override fun provideSummary(preference: Preference): CharSequence { val ep = preference as EditTextPreference var summary = ep.text ?: "" if (summary == "8.8.4.4" || summary == "8.8.8.8" || summary == "2001:4860:4860::8888" || summary == "2001:4860:4860::8844" ) |