From eb21309289558273ab3c95fc2f644c6cf07b2527 Mon Sep 17 00:00:00 2001 From: quobix Date: Wed, 3 Apr 2024 12:06:42 -0400 Subject: [PATCH] Fixed NPE discovered in the platform Signed-off-by: quobix --- functions/openapi/component_descriptions.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/functions/openapi/component_descriptions.go b/functions/openapi/component_descriptions.go index 30725825..01b420ea 100644 --- a/functions/openapi/component_descriptions.go +++ b/functions/openapi/component_descriptions.go @@ -76,12 +76,14 @@ func (cd ComponentDescription) RunRule(_ []*yaml.Node, context model.RuleFunctio key := schemaPairs.Key() k, _ := low.FindItemInOrderedMapWithKey(key, components.Value.GoLow().Schemas.Value) - checkDescription(schemaValue.Schema.Value.Description, - key, - "schemas", - schemaValue.GenerateJSONPath(), - k.GetKeyNode(), - schemaValue) + if schemaValue.Schema != nil && schemaValue.Schema.Value != nil { + checkDescription(schemaValue.Schema.Value.Description, + key, + "schemas", + schemaValue.GenerateJSONPath(), + k.GetKeyNode(), + schemaValue) + } } }