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

@@ -965,3 +965,27 @@ All.
b.AssertLogContains("! WARN")
}
func TestCascadeNilMapIssue13853(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
-- content/test/_index.md --
---
title: Test
cascade:
- build:
list: local
target:
path: '{/test/**}'
- params:
title: 'Test page'
target:
path: '{/test/**}'
---
`
// Just verify that it does not panic.
_ = Test(t, files)
}