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:
commit
8c6260ed8d
@ -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
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user