diff --git a/v2/pkg/templates/compile.go b/v2/pkg/templates/compile.go index fcf480e21..3fb25b6ae 100644 --- a/v2/pkg/templates/compile.go +++ b/v2/pkg/templates/compile.go @@ -48,7 +48,7 @@ func Parse(filePath string, options protocols.ExecuterOptions) (*Template, error if len(options.Options.Tags) > 0 { templateTags, ok := template.Info["tags"] if !ok { - return nil, nil + templateTags = "" } if err := matchTemplateWithTags(types.ToString(templateTags), types.ToString(template.Info["severity"]), options.Options); err != nil { return nil, nil diff --git a/v2/pkg/templates/compile_test.go b/v2/pkg/templates/compile_test.go index 299f63940..7eb722794 100644 --- a/v2/pkg/templates/compile_test.go +++ b/v2/pkg/templates/compile_test.go @@ -34,4 +34,9 @@ func TestMatchTemplateWithTags(t *testing.T) { err = matchTemplateWithTags("lang:php,os:linux,cms:symfony", "low", &types.Options{Tags: []string{"low"}}) require.Nil(t, err, "could get key value tag for severity") }) + + t.Run("blank-tags", func(t *testing.T) { + err = matchTemplateWithTags("", "low", &types.Options{Tags: []string{"jira"}}) + require.NotNil(t, err, "could get value tag for blank severity") + }) }