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鈥檒l 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 · 6 comments 路 Fixed by #6224

Comments

@regisphilibert
Copy link

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

commented Aug 14, 2019

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

@bep

This comment has been minimized.

@regisphilibert

This comment has been minimized.

Copy link
Author

commented Aug 14, 2019

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

This comment has been minimized.

Copy link
Contributor

commented Aug 14, 2019

I was getting the same error because I had

outputs: "Reveal"

instead of

outputs: ["Reveal"]
@bep

This comment has been minimized.

Copy link
Member

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
hugolib: Fix draft etc. handling of _index.md pages
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
hugolib: Fix draft etc. handling of _index.md pages
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
hugolib: Fix draft etc. handling of _index.md pages
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 in #6224 Aug 15, 2019

bep added a commit that referenced this issue Aug 15, 2019
hugolib: Fix draft etc. handling of _index.md pages
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can鈥檛 perform that action at this time.