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

Page properties returns inv. mem. address despite conditional on 57 #6210

Closed
regisphilibert opened this issue Aug 14, 2019 · 7 comments · Fixed by #6224
Closed

Page properties returns inv. mem. address despite conditional on 57 #6210

regisphilibert opened this issue Aug 14, 2019 · 7 comments · Fixed by #6224

Comments

@regisphilibert
Copy link
Member

regisphilibert commented Aug 14, 2019

I'm getting nil pointer references with the following property even wrapped in a with

{{ with .WordCount }}
{{ . }}
{{ end }}

👉 error calling WordCount: runtime error: invalid memory address or nil pointer dereference

  • WordCount
  • Summary
  • Content
    Maybe more 🤷‍♂

Issue also happens with internal template: executing "_internal/_default/rss.xml" at <.Summary>: error calling Summary: runtime error: invalid memory address or nil pointer dereference

I think all it takes is a page with no content.

@bep
Copy link
Member

bep commented Aug 14, 2019

I assume the nilpointer is happening inside those methods, so with won't help. Hmm. I would think we would have a million tests for this.

@bep bep added this to the v0.57.1 milestone Aug 14, 2019
@bep
Copy link
Member

bep commented Aug 14, 2019

Quick question before I spend time on this: Anything special about this site of yours?

@bep
Copy link
Member

bep commented Aug 14, 2019

@regisphilibert
Copy link
Member Author

I'm sorry I have no time to run test just yet on smaller repos. But yes, always some special stuff in there. I'll try and setup a repo for you, if no noise in the discourse, it must means it's not necessarily a broad issue.

@brunoamaral
Copy link
Contributor

I was getting the same error because I had

outputs: "Reveal"

instead of

outputs: ["Reveal"]

@bep
Copy link
Member

bep commented Aug 15, 2019

Yes, I'm suspecting this happens when there for some reason happens to be no output formats defined for a page (I assume "outputs: "Reveal" => []")

@bep bep modified the milestones: v0.57.1, v0.57.2 Aug 15, 2019
bep added a commit that referenced this issue Aug 15, 2019
bep added a commit that referenced this issue Aug 15, 2019
bep added a commit to bep/hugo that referenced this issue Aug 15, 2019
We will need to revisit this with a proper spec, but this commit makes sure that draft/expiryDate etc. set in front matter on _index.md content files that should disable the page will:

* Not crash
* Make the rendered page not render any `.Content`.

Fixes gohugoio#6222
Fixes gohugoio#6210
bep added a commit to bep/hugo that referenced this issue Aug 15, 2019
We will need to revisit this with a proper spec, but this commit makes sure that draft/expiryDate etc. set in front matter on _index.md content files that should disable the page will:

* Not crash
* Make the rendered page not render any `.Content`.

Fixes gohugoio#6222
Fixes gohugoio#6210
bep added a commit to bep/hugo that referenced this issue Aug 15, 2019
We will need to revisit this with a proper spec, but this commit makes sure that draft/expiryDate etc. set in front matter on _index.md content files that should disable the page will:

* Not crash
* Make the rendered page not render any `.Content`.

Fixes gohugoio#6222
Fixes gohugoio#6210
@bep bep closed this as completed in #6224 Aug 15, 2019
bep added a commit that referenced this issue Aug 15, 2019
We will need to revisit this with a proper spec, but this commit makes sure that draft/expiryDate etc. set in front matter on _index.md content files that should disable the page will:

* Not crash
* Make the rendered page not render any `.Content`.

Fixes #6222
Fixes #6210
@bep bep modified the milestones: v0.57.2, v0.57.1 Aug 17, 2019
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants