Skip to content

Mermaid graph with no parameters defined in hugo config results in 'Uncaught TypeError' #1882

@chulcher

Description

@chulcher

var params = {{ .Site.Params.mermaid | jsonify | safeJS }};

If nothing is defined in hugo.toml for [params.mermaid] then the referenced code results in var params = null being generated.

if (defaultConfig.hasOwnProperty(key) && params.hasOwnProperty(keyLower)) {

Then when attempting the if statement a call is made against a null value, resulting in the browser console error.

Uncaught TypeError: Cannot read properties of null (reading 'hasOwnProperty')

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinge0-minutesEffort < 60 min

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions