handle nil properly with file nodes

This commit is contained in:
Jesse Duffield 2022-08-01 20:32:01 +10:00
parent 4ffc9a5395
commit 95426c5e46
2 changed files with 8 additions and 0 deletions

View file

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