fix: runtime error: invalid memory address or nil pointer dereference

This commit is contained in:
Arthur Fritz Santiago 2023-04-29 18:03:09 -03:00
parent bbe3055006
commit 2b4f0b5a87

View File

@ -46,6 +46,9 @@ func (dec *jsonDecoder) Decode() (*CandidateNode, error) {
} }
func (dec *jsonDecoder) convertToYamlNode(data *orderedMap) (*yaml.Node, error) { func (dec *jsonDecoder) convertToYamlNode(data *orderedMap) (*yaml.Node, error) {
if data == nil {
return createScalarNode(nil, "null"), nil
}
if data.kv == nil { if data.kv == nil {
switch rawData := data.altVal.(type) { switch rawData := data.altVal.(type) {
case nil: case nil: