# No changes to code: runtime error: invalid memory address or nil pointer dereference

**URL:** <https://discourse.gohugo.io/t/no-changes-to-code-runtime-error-invalid-memory-address-or-nil-pointer-dereference/35477>\
**Category:** support\
**Created:** [November 6, 2021, 4:53pm UTC](https://discourse.gohugo.io/t/no-changes-to-code-runtime-error-invalid-memory-address-or-nil-pointer-dereference/35477 "2021-11-06T16:53:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![runhide](https://avatars.discourse-cdn.com/v4/letter/r/eada6e/32.png) [@runhide](https://discourse.gohugo.io/u/runhide)\
**Post date:** [November 6, 2021, 4:53pm UTC](https://discourse.gohugo.io/t/no-changes-to-code-runtime-error-invalid-memory-address-or-nil-pointer-dereference/35477/1 "2021-11-06T16:53:56Z")

</div>

I appreciate this will be a difficult question to help with as I can’t share my project, but any pointers would be much appreciated.

I added two new content files this morning to my project and now I get the error message: “runtime error: invalid memory address or nil pointer dereference”. I revert to the last build that succeeded and now that also gets the same error message.

Thoughts?

---

<div class="post-metadata">

**Author:** ![runhide](https://avatars.discourse-cdn.com/v4/letter/r/eada6e/32.png) [@runhide](https://discourse.gohugo.io/u/runhide)\
**Post date:** [November 6, 2021, 5:39pm UTC](https://discourse.gohugo.io/t/no-changes-to-code-runtime-error-invalid-memory-address-or-nil-pointer-dereference/35477/2 "2021-11-06T17:39:36Z")

</div>

3 hours later, and I’ve managed to figure this out. One of my custom parameters in front matter was misspelled, “pproduct” instead of “product” for a file that was committed a few days ago (hence no error yesterday) but was scheduled to be published today. An error on my part.

It would be awesome, but I appreciate this is difficult and perhaps not possible, to have more descriptive error messages.

---

<div class="post-metadata">

**Author:** ![RA\_KTO](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ra_kto/32/15418_2.png) [@RA\_KTO](https://discourse.gohugo.io/u/RA_KTO)\
**Post date:** [November 6, 2021, 6:35pm UTC](https://discourse.gohugo.io/t/no-changes-to-code-runtime-error-invalid-memory-address-or-nil-pointer-dereference/35477/3 "2021-11-06T18:35:05Z")

</div>

You can use Hugo’s `errorf` to create your own error messages.

```auto
{{ if not (isset .Params "product") }}
  {{ errorf "Page %s does not have Params.product set." .Path }}
{{ end }}

```

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [November 8, 2021, 6:35pm UTC](https://discourse.gohugo.io/t/no-changes-to-code-runtime-error-invalid-memory-address-or-nil-pointer-dereference/35477/4 "2021-11-08T18:35:41Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
