mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
Return an error if some node in the path is not a dictionary
This commit is contained in:
@ -52,6 +52,10 @@ func updateYamlNode(node *yaml.Node, path []string, value string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
if node.Kind != yaml.MappingNode {
|
||||
return errors.New("yaml node in path is not a dictionary")
|
||||
}
|
||||
|
||||
key := path[0]
|
||||
for i := 0; i < len(node.Content)-1; i += 2 {
|
||||
if node.Content[i].Value == key {
|
||||
|
Reference in New Issue
Block a user