Fix panic on server rebuilds when using both base templates and template.Defer

Fixes #12963
This commit is contained in:
Bjørn Erik Pedersen
2024-12-13 13:57:23 +01:00
parent 565c30eac9
commit a5e5be234c
5 changed files with 110 additions and 65 deletions

View File

@@ -65,6 +65,9 @@ func (q *EvictingStringQueue) Len() int {
// Contains returns whether the queue contains v.
func (q *EvictingStringQueue) Contains(v string) bool {
if q == nil {
return false
}
q.mu.Lock()
defer q.mu.Unlock()
return q.set[v]