mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
tpl: Fix reflection bug in merge
Value.Type().Key() must only be called on map values. Fixes #7899
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
56a343507c
commit
6d95dc9d74
@@ -106,6 +106,10 @@ func mergeMap(dst, src reflect.Value) reflect.Value {
|
||||
dve := dv.Elem()
|
||||
if dve.Kind() == reflect.Map {
|
||||
sve := sv.Elem()
|
||||
if sve.Kind() != reflect.Map {
|
||||
continue
|
||||
}
|
||||
|
||||
if dve.Type().Key() == sve.Type().Key() {
|
||||
out.SetMapIndex(key, mergeMap(dve, sve))
|
||||
}
|
||||
|
Reference in New Issue
Block a user