瀏覽代碼

fix: avoid empty tool provider tags

Yeuoly 8 月之前
父節點
當前提交
947252609e
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      internal/types/entities/plugin_entities/tool_declaration.go

+ 8 - 0
internal/types/entities/plugin_entities/tool_declaration.go

@@ -217,6 +217,10 @@ func (t *ToolProviderDeclaration) UnmarshalYAML(value *yaml.Node) error {
 		t.Tools = []ToolDeclaration{}
 	}
 
+	if t.Identity.Tags == nil {
+		t.Identity.Tags = []manifest_entities.PluginTag{}
+	}
+
 	return nil
 }
 
@@ -279,6 +283,10 @@ func (t *ToolProviderDeclaration) UnmarshalJSON(data []byte) error {
 		t.Tools = []ToolDeclaration{}
 	}
 
+	if t.Identity.Tags == nil {
+		t.Identity.Tags = []manifest_entities.PluginTag{}
+	}
+
 	return nil
 }