1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-10-31 02:25:35 +03:00

fix bug caused by interface

This commit is contained in:
Jesse Duffield
2021-04-01 09:25:11 +11:00
parent 0b7bda291c
commit 949c7726d1
3 changed files with 10 additions and 3 deletions

View File

@@ -89,6 +89,11 @@ func (m *CommitFileManager) ToggleCollapsed(path string) {
}
func (m *CommitFileManager) Render(diffName string, patchManager *patch.PatchManager) []string {
// can't rely on renderAux to check for nil because an interface won't be nil if its concrete value is nil
if m.tree == nil {
return []string{}
}
return renderAux(m.tree, m.collapsedPaths, "", -1, func(n INode, depth int) string {
castN := n.(*CommitFileNode)