Fix out of range panic in yaml decoder

This commit is contained in:
Navid 2025-09-03 20:13:54 +02:00 committed by Mike Farah
parent 78bc9baffd
commit 49b6477c49

View File

@ -129,6 +129,8 @@ func (dec *yamlDecoder) Decode() (*CandidateNode, error) {
return nil, err
} else if err != nil {
return nil, err
} else if len(yamlNode.Content) == 0 {
return nil, errors.New("yaml node has no content")
}
candidateNode := CandidateNode{document: dec.documentIndex}