tpl: Avoid panic on nonsensical return construct

Fixes #13600
This commit is contained in:
Bjørn Erik Pedersen
2025-04-14 11:55:57 +02:00
parent cf9e6904cc
commit e8e8ce10d2
2 changed files with 20 additions and 0 deletions

View File

@@ -175,6 +175,9 @@ func (c *templateTransformContext) applyTransformations(n parse.Node) (bool, err
}
case *parse.CommandNode:
if x == nil {
return true, nil
}
c.collectInner(x)
keep := c.collectReturnNode(x)