From 5fe2c74cc7b98a68cc765c2397346aee7b8c6097 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Fri, 7 Jun 2019 12:09:03 +0530 Subject: Target Android Q Signed-off-by: Harsh Shandilya --- app/src/main/java/com/zeapo/pwdstore/UserPreference.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt index 97462fd2..7f35db6f 100644 --- a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt +++ b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt @@ -193,12 +193,8 @@ class UserPreference : AppCompatActivity() { findPreference("clear_after_copy").isEnabled = sharedPreferences.getString("general_show_time", "45")?.toInt() != 0 findPreference("clear_clipboard_20x").isEnabled = sharedPreferences.getString("general_show_time", "45")?.toInt() != 0 val keyPref = findPreference("openpgp_key_id_pref") - val selectedKeys: Array = ArrayList( - sharedPreferences.getStringSet( - "openpgp_key_ids_set", - HashSet() - ) - ).toTypedArray() + val selectedKeys = (sharedPreferences.getStringSet("openpgp_key_ids_set", null) + ?: HashSet()).toTypedArray() if (selectedKeys.isEmpty()) { keyPref.summary = this.resources.getString(R.string.pref_no_key_selected) } else { -- cgit v1.2.3