mirror of
				https://github.com/jesseduffield/lazygit.git
				synced 2025-10-30 23:57:43 +02:00 
			
		
		
		
	Merge pull request #2077 from jesseduffield/file-node-fix
handle nil properly with file nodes
This commit is contained in:
		| @@ -17,5 +17,9 @@ func NewCommitFileNode(node *Node[models.CommitFile]) *CommitFileNode { | |||||||
|  |  | ||||||
| // returns the underlying node, without any commit-file-specific methods attached | // returns the underlying node, without any commit-file-specific methods attached | ||||||
| func (self *CommitFileNode) Raw() *Node[models.CommitFile] { | func (self *CommitFileNode) Raw() *Node[models.CommitFile] { | ||||||
|  | 	if self == nil { | ||||||
|  | 		return nil | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	return self.Node | 	return self.Node | ||||||
| } | } | ||||||
|   | |||||||
| @@ -19,6 +19,10 @@ func NewFileNode(node *Node[models.File]) *FileNode { | |||||||
|  |  | ||||||
| // returns the underlying node, without any file-specific methods attached | // returns the underlying node, without any file-specific methods attached | ||||||
| func (self *FileNode) Raw() *Node[models.File] { | func (self *FileNode) Raw() *Node[models.File] { | ||||||
|  | 	if self == nil { | ||||||
|  | 		return nil | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	return self.Node | 	return self.Node | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user