QueryLibrary: Use default variable values in render (#84678)

This commit is contained in:
Kyle Brandt
2024-03-27 08:48:08 -04:00
committed by GitHub
parent 7ad2ec9665
commit d71266b8af
2 changed files with 40 additions and 2 deletions
+5 -1
View File
@@ -43,7 +43,11 @@ func RenderTemplate(qt QueryTemplate, selectedValues map[string][]string) ([]Tar
s = s[1 : len(s)-1]
var offSet int64
for _, r := range reps {
value := []rune(FormatVariables(r.format, selectedValues[r.Key]))
sV := selectedValues[r.Key]
if sV == nil {
sV = r.DefaultValues
}
value := []rune(FormatVariables(r.format, sV))
if r.Position == nil {
return nil, fmt.Errorf("nil position not support yet, will be full replacement")
}