diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2020-02-21 22:22:55 +0530 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2020-02-21 23:01:54 +0530 |
commit | af9f8f529beb1cd95c05e3e04a185f4ef408787b (patch) | |
tree | bd4fa737a88e62b77d36cf2930559fce11f7dfc4 /app/src | |
parent | 812b92ab38fb1104780d850c470ae208a5cc3a8b (diff) |
UserPreference: Fix changes from 9787489bc5b7
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/UserPreference.kt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt index 469e3773..50d5bcad 100644 --- a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt +++ b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt @@ -481,7 +481,8 @@ class UserPreference : AppCompatActivity() { // TODO: This is fragile. Workaround until PasswordItem is backed by DocumentFile val docId = DocumentsContract.getTreeDocumentId(uri) val split = docId.split(":".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() - val repoPath = "${Environment.getExternalStorageDirectory()}/${split[1] ?: split[0]}" + val path = if (split.size > 0) split[1] else split[0] + val repoPath = "${Environment.getExternalStorageDirectory()}/$path" Timber.tag(TAG).d("Selected repository path is $repoPath") |