mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-04 03:48:07 +02:00
handle nil properly with file nodes
This commit is contained in:
parent
4ffc9a5395
commit
95426c5e46
@ -17,5 +17,9 @@ func NewCommitFileNode(node *Node[models.CommitFile]) *CommitFileNode {
|
||||
|
||||
// returns the underlying node, without any commit-file-specific methods attached
|
||||
func (self *CommitFileNode) Raw() *Node[models.CommitFile] {
|
||||
if self == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return self.Node
|
||||
}
|
||||
|
@ -19,6 +19,10 @@ func NewFileNode(node *Node[models.File]) *FileNode {
|
||||
|
||||
// returns the underlying node, without any file-specific methods attached
|
||||
func (self *FileNode) Raw() *Node[models.File] {
|
||||
if self == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return self.Node
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user