Fix assignment to entry in nil map

Fixes #13853
This commit is contained in:
Bjørn Erik Pedersen
2025-07-10 16:28:36 +02:00
parent a84beee429
commit 6f42cfbc9b
3 changed files with 28 additions and 4 deletions

View File

@@ -177,6 +177,9 @@ func mapToPageMatcherParamsConfig(m map[string]any) (PageMatcherParamsConfig, er
if pcfg.Fields == nil {
pcfg.Fields = make(maps.Params)
}
if pcfg.Params == nil {
pcfg.Params = make(maps.Params)
}
for k, v := range m {
switch strings.ToLower(k) {
case "_target", "target":
@@ -186,9 +189,6 @@ func mapToPageMatcherParamsConfig(m map[string]any) (PageMatcherParamsConfig, er
}
pcfg.Target = target
case "params":
if pcfg.Params == nil {
pcfg.Params = make(maps.Params)
}
params := maps.ToStringMap(v)
for k, v := range params {
if _, found := pcfg.Params[k]; !found {
@@ -196,7 +196,6 @@ func mapToPageMatcherParamsConfig(m map[string]any) (PageMatcherParamsConfig, er
}
}
default:
pcfg.Fields[k] = v
}
}