Fixed crash when changing tabs
This commit is contained in:
parent
1af4542c7c
commit
7b5290aef8
@ -117,8 +117,6 @@ class TabViewModel @Inject constructor(
|
|||||||
|
|
||||||
repository.workTree // test if repository is valid
|
repository.workTree // test if repository is valid
|
||||||
_repositorySelectionStatus.value = RepositorySelectionStatus.Open(repository)
|
_repositorySelectionStatus.value = RepositorySelectionStatus.Open(repository)
|
||||||
val git = Git(repository)
|
|
||||||
tabState.initGit(git)
|
|
||||||
|
|
||||||
val path = if (directory.name == ".git") {
|
val path = if (directory.name == ".git") {
|
||||||
directory.parent
|
directory.parent
|
||||||
@ -126,7 +124,10 @@ class TabViewModel @Inject constructor(
|
|||||||
directory.absolutePath
|
directory.absolutePath
|
||||||
|
|
||||||
onRepositoryChanged(path)
|
onRepositoryChanged(path)
|
||||||
tabState.newSelectedItem(selectedItem = SelectedItem.UncommittedChanges)
|
|
||||||
|
val git = Git(repository)
|
||||||
|
tabState.initGit(git)
|
||||||
|
tabState.refreshData(RefreshType.ALL_DATA)
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
onRepositoryChanged(null)
|
onRepositoryChanged(null)
|
||||||
ex.printStackTrace()
|
ex.printStackTrace()
|
||||||
|
Loading…
Reference in New Issue
Block a user