From f7901747e8812b4f4e2c454942b487b067c987d2 Mon Sep 17 00:00:00 2001 From: Dave Shanley Date: Wed, 21 Jun 2023 08:58:11 -0400 Subject: [PATCH] nil pointer check added to prevent panic. When building docs from scratch, a slice that is not backed by a low level model could throw a NPE, now fixed. non breaking change. Signed-off-by: Dave Shanley --- datamodel/high/node_builder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datamodel/high/node_builder.go b/datamodel/high/node_builder.go index dbff75db..71b87507 100644 --- a/datamodel/high/node_builder.go +++ b/datamodel/high/node_builder.go @@ -435,7 +435,7 @@ func (n *NodeBuilder) AddYAMLNode(parent *yaml.Node, entry *NodeEntry) *yaml.Nod if glu, ok := sqi.(GoesLowUntyped); ok { if glu != nil { ut := glu.GoLowUntyped() - if !reflect.ValueOf(ut).IsNil() { + if ut != nil && !reflect.ValueOf(ut).IsNil() { r := ut.(low.IsReferenced) if ut != nil && r.GetReference() != "" && ut.(low.IsReferenced).IsReference() {