summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2020-06-30 14:37:59 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2020-06-30 14:39:22 +0530
commitb663fbe64f41f34ed66842835876779d1f923e22 (patch)
treeb559e3cab6a3cb4d09fb923423b1969466d64875 /app
parent52808fb1266d3a1763ba1fba0c79e5ef5367b5de (diff)
Workaround to prevent crash on first run (#898)
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> (cherry picked from commit 57f125a4da9f8bad69c2b2e2e6540d245bdd44c4) Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt b/app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt
index 69205241..05ccf28f 100644
--- a/app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt
@@ -291,6 +291,7 @@ class SearchableRepositoryViewModel(application: Application) : AndroidViewModel
recyclerViewState: Parcelable? = null,
pushPreviousLocation: Boolean = true
) {
+ if (!newDirectory.exists()) return
require(newDirectory.isDirectory) { "Can only navigate to a directory" }
if (pushPreviousLocation) {
navigationStack.push(NavigationStackEntry(_currentDir.value!!, recyclerViewState))