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

Commit af9f8f5

Browse files
committed
UserPreference: Fix changes from 9787489
Signed-off-by: Harsh Shandilya <[email protected]>
1 parent 812b92a commit af9f8f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,8 @@ class UserPreference : AppCompatActivity() {
481481
// TODO: This is fragile. Workaround until PasswordItem is backed by DocumentFile
482482
val docId = DocumentsContract.getTreeDocumentId(uri)
483483
val split = docId.split(":".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
484-
val repoPath = "${Environment.getExternalStorageDirectory()}/${split[1] ?: split[0]}"
484+
val path = if (split.size > 0) split[1] else split[0]
485+
val repoPath = "${Environment.getExternalStorageDirectory()}/$path"
485486

486487
Timber.tag(TAG).d("Selected repository path is $repoPath")
487488

0 commit comments

Comments
 (0)