Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix annoying .File.Path on zero object. warning #1124

Merged
merged 1 commit into from
Dec 18, 2023
Merged

Fix annoying .File.Path on zero object. warning #1124

merged 1 commit into from
Dec 18, 2023

Conversation

arunoruto
Copy link
Contributor

@arunoruto arunoruto commented Dec 16, 2023

When I was creating a post, I was getting this warning:

WARN  .File.Path on zero object. Wrap it in if or with: {{ with .File }}{{ .Path }}{{ end }}

So I did as suggested and replaced the .File.Path using a with statement in the list.html and single.html files. So far, the warning hasn't popped up again.
I am not sure why this warning comes up, but I hope this will mitigate weird behavior in the future.

I noticed this warning in two issues #602 and #490

@nunocoracao nunocoracao changed the base branch from main to dev December 18, 2023 16:08
@nunocoracao nunocoracao merged commit 6611e0f into nunocoracao:dev Dec 18, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants