1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-04 10:34:55 +02:00

Merge pull request #1914 from Ryooooooga/feature/fix-crash-empty-panel

This commit is contained in:
Jesse Duffield 2022-05-06 08:38:06 +10:00 committed by GitHub
commit 8c6260ed8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 35 additions and 7 deletions

View File

@ -58,5 +58,9 @@ func (self *BranchesContext) GetSelectedItemId() string {
}
func (self *BranchesContext) GetSelectedRef() types.Ref {
return self.GetSelected()
branch := self.GetSelected()
if branch == nil {
return nil
}
return branch
}

View File

@ -84,7 +84,11 @@ func (self *LocalCommitsContext) CanRebase() bool {
}
func (self *LocalCommitsContext) GetSelectedRef() types.Ref {
return self.GetSelected()
commit := self.GetSelected()
if commit == nil {
return nil
}
return commit
}
func (self *LocalCommitsViewModel) SetLimitCommits(value bool) {

View File

@ -62,7 +62,11 @@ func (self *ReflogCommitsContext) CanRebase() bool {
}
func (self *ReflogCommitsContext) GetSelectedRef() types.Ref {
return self.GetSelected()
commit := self.GetSelected()
if commit == nil {
return nil
}
return commit
}
func (self *ReflogCommitsContext) GetCommits() []*models.Commit {

View File

@ -61,5 +61,9 @@ func (self *RemoteBranchesContext) GetSelectedItemId() string {
}
func (self *RemoteBranchesContext) GetSelectedRef() types.Ref {
return self.GetSelected()
remoteBranch := self.GetSelected()
if remoteBranch == nil {
return nil
}
return remoteBranch
}

View File

@ -62,5 +62,9 @@ func (self *StashContext) CanRebase() bool {
}
func (self *StashContext) GetSelectedRef() types.Ref {
return self.GetSelected()
stash := self.GetSelected()
if stash == nil {
return nil
}
return stash
}

View File

@ -83,7 +83,11 @@ func (self *SubCommitsContext) CanRebase() bool {
}
func (self *SubCommitsContext) GetSelectedRef() types.Ref {
return self.GetSelected()
commit := self.GetSelected()
if commit == nil {
return nil
}
return commit
}
func (self *SubCommitsContext) GetCommits() []*models.Commit {

View File

@ -58,5 +58,9 @@ func (self *TagsContext) GetSelectedItemId() string {
}
func (self *TagsContext) GetSelectedRef() types.Ref {
return self.GetSelected()
tag := self.GetSelected()
if tag == nil {
return nil
}
return tag
}