From de7ffca37fcbb278b337617cacdd5503bf361c84 Mon Sep 17 00:00:00 2001 From: Jougan-0 Date: Sat, 24 Aug 2024 00:03:20 +0530 Subject: [PATCH] add missing check w/signoff Signed-off-by: Jougan-0 --- models/v1beta1/component/component_helper.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/models/v1beta1/component/component_helper.go b/models/v1beta1/component/component_helper.go index 705ddb5144..5ec0635af4 100644 --- a/models/v1beta1/component/component_helper.go +++ b/models/v1beta1/component/component_helper.go @@ -49,6 +49,9 @@ func (c *ComponentDefinition) Create(db *database.Handler, hostID uuid.UUID) (uu } if !utils.IsSchemaEmpty(c.Component.Schema) { + if c.Metadata.AdditionalProperties == nil { + c.Metadata.AdditionalProperties = make(map[string]interface{}) + } c.Metadata.AdditionalProperties["hasInvalidSchema"] = true }