From 57f125a4da9f8bad69c2b2e2e6540d245bdd44c4 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Tue, 30 Jun 2020 14:37:59 +0530 Subject: Workaround to prevent crash on first run (#898) Signed-off-by: Harsh Shandilya --- app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt | 1 + 1 file changed, 1 insertion(+) (limited to 'app/src/main') 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)) -- cgit v1.2.3