Skip to content

Commit

Permalink
nil pointer check added to prevent panic.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
daveshanley committed Jun 21, 2023
1 parent a4b7a01 commit f790174
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datamodel/high/node_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit f790174

Please sign in to comment.