Workaround to prevent crash on first run (#898)

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya
2020-06-30 14:37:59 +05:30
committed by GitHub
parent 8bc662c9c0
commit 57f125a4da

View File

@@ -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))