Skip to content

fix: guard trimStart call in analyseImport against null names (#170)#181

Open
JuliaKalder wants to merge 1 commit into
mainfrom
fix/issue-170
Open

fix: guard trimStart call in analyseImport against null names (#170)#181
JuliaKalder wants to merge 1 commit into
mainfrom
fix/issue-170

Conversation

@JuliaKalder
Copy link
Copy Markdown
Owner

Summary

Guard trimStart call against null/missing template names in analyseImport().

Changes

  • validation.js: Changed t.name.trim() to (t.name || "").trim() to handle null/undefined names in two places: the seenNames Map initialization and the import loop key generation.

Testing

All 96 tests pass.

Fixes #170

Guard t.name with null-coalescing (t.name || "") before calling
toLowerCase() and trim() in analyseImport() to prevent TypeError when
existing templates have null or undefined names.

Fixes #170
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.

[MEDIUM] analyseImport (validation.js:55) crashes with TypeError on existing templates with null/missing names

1 participant