Skip to content

fix: prevent undefined relatedNodes from halting axe#3778

Merged
WilcoFiers merged 2 commits intodevelopfrom
related-node-error
Nov 14, 2022
Merged

fix: prevent undefined relatedNodes from halting axe#3778
WilcoFiers merged 2 commits intodevelopfrom
related-node-error

Conversation

@WilcoFiers
Copy link
Copy Markdown
Contributor

This PR fixes the reporter throwing an error when the relatedNode is undefined.

Instead the source is now reported as "Undefined"

Closes issues #3733 and #3627

@WilcoFiers WilcoFiers marked this pull request as ready for review November 14, 2022 17:19
@WilcoFiers WilcoFiers requested a review from a team as a code owner November 14, 2022 17:19
@WilcoFiers WilcoFiers merged commit efefb18 into develop Nov 14, 2022
@WilcoFiers WilcoFiers deleted the related-node-error branch November 14, 2022 17:44
checkRes.relatedNodes = checkRes.relatedNodes.map(relatedNode => {
var res = {
html: relatedNode.source
html: relatedNode?.source ?? 'Undefined'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have made this all lowercase so it looks like A Javascript stringification of a variable with a value of undefined, but nbd

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.

3 participants