Open mlaventure opened 4 years ago
Can you provide a minimal template which panics? This helps me debugging. Thanks!
Can you provide a minimal template which panics? This helps me debugging. Thanks!
I figured, I've been trying to find one before opening a PR, I couldn't so I opened this issue instead. We'll keep trying, I may have had an idea of the difference between my current template and the one in the tests
Got it: It's when within a double loop:
{% for comment in complex.comments2 %}
{% for comment2 in complex.comments2 %}
{% ifchanged comment2.author.validated %}
// This will panic
{% endifchanged %}
{% endfor %}
{% endfor %}
Thanks! Will have a look soon.
I am not sure what's special about my template code, but I get this panic when trying to use
ifchanged
without an else close.I fixed it locally by check if
node.elseWrapper != nil
ontags_ifchanged.go:59
but I didn't dig into the details to figure out why it can happens when the similar code in thetemplate_tests
directory seems to do just fine.This was on
go version go1.14 linux/amd64
, the relevant panic part was: