fix issue when switching repos while files refresh

This commit is contained in:
Jesse Duffield 2021-04-05 14:24:28 +10:00
parent c9ded489c9
commit 267da3b4db
2 changed files with 14 additions and 2 deletions

View file

@ -111,7 +111,13 @@ func (node *CommitFileNode) GetNodeAtIndex(index int, collapsedPaths map[string]
return nil
}
return getNodeAtIndex(node, index, collapsedPaths).(*CommitFileNode)
result := getNodeAtIndex(node, index, collapsedPaths)
if result == nil {
// not sure how this can be nil: we probably are missing a mutex somewhere
return nil
}
return result.(*CommitFileNode)
}
func (node *CommitFileNode) GetIndexForPath(path string, collapsedPaths map[string]bool) (int, bool) {