1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-03-19 21:28:28 +02:00

Merge pull request from jesseduffield/file-node-fix

handle nil properly with file nodes
This commit is contained in:
Jesse Duffield 2022-08-01 20:36:26 +10:00 committed by GitHub
commit 81f80ce968
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

@ -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
}