mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-05 03:45:41 +00:00
Fix out of range panic in yaml decoder
This commit is contained in:
parent
7d49d408ef
commit
ff40a023cc
@ -129,6 +129,8 @@ func (dec *yamlDecoder) Decode() (*CandidateNode, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
} else if len(yamlNode.Content) == 0 {
|
||||||
|
return nil, errors.New("yaml node has no content")
|
||||||
}
|
}
|
||||||
|
|
||||||
candidateNode := CandidateNode{document: dec.documentIndex}
|
candidateNode := CandidateNode{document: dec.documentIndex}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user