Skip to content

Commit

Permalink
Fixed crash when changing tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
JetpackDuba committed Sep 8, 2024
1 parent 1af4542 commit 7b5290a
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,17 @@ class TabViewModel @Inject constructor(

repository.workTree // test if repository is valid
_repositorySelectionStatus.value = RepositorySelectionStatus.Open(repository)
val git = Git(repository)
tabState.initGit(git)

val path = if (directory.name == ".git") {
directory.parent
} else
directory.absolutePath

onRepositoryChanged(path)
tabState.newSelectedItem(selectedItem = SelectedItem.UncommittedChanges)

val git = Git(repository)
tabState.initGit(git)
tabState.refreshData(RefreshType.ALL_DATA)
} catch (ex: Exception) {
onRepositoryChanged(null)
ex.printStackTrace()
Expand Down

0 comments on commit 7b5290a

Please sign in to comment.