Error: unable to cast <nil> since hugo v0.87 #8865
Comments
|
Not sure if this is a bug or not, but first you should just be able to do something like: Second, if you'd like to cleanup your code a bit you can include all your comments into a single comment: |
|
@braderhart Thanks for your input. I adjusted the code to but I still get the error |
|
I'm not sure how the above could have changed in the latest release, but we should handle nil inputs, so I will fix that. That said, the reason @braderhart 's suggestion does not work is that and/or in Go templates does not short circuit (this will be fixed in Go 1.17). |
|
I have reverted the above "fix" after thinking about it:
|
|
Then how can I adjust the code to avoid |
|
@AndreasAZiegler Please show an example of event frontmatter. |
|
Below an example of |
|
There may be a more concise way to do this... |
|
More concise... |
What version of Hugo are you using (
hugo version)?Does this issue reproduce with the latest release?
Yes
Since hugo v0.87.0 we get the error
for this part of the code
The text was updated successfully, but these errors were encountered: