Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 2c6d454

Browse files
authored
UserPreference: fix my inability to count (#863)
1 parent 585d598 commit 2c6d454

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/src/main/java/com/zeapo/pwdstore/UserPreference.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ class UserPreference : AppCompatActivity() {
676676
// TODO: This is fragile. Workaround until PasswordItem is backed by DocumentFile
677677
val docId = DocumentsContract.getTreeDocumentId(uri)
678678
val split = docId.split(":".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
679-
val path = if (split.isNotEmpty()) split[1] else split[0]
679+
val path = if (split.size > 1) split[1] else split[0]
680680
val repoPath = "${Environment.getExternalStorageDirectory()}/$path"
681681
val prefs = PreferenceManager.getDefaultSharedPreferences(applicationContext)
682682

0 commit comments

Comments
 (0)