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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent undefined relatedNodes from halting axe #3778

Merged
merged 2 commits into from Nov 14, 2022

Conversation

WilcoFiers
Copy link
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
@@ -10,19 +10,19 @@ function normalizeRelatedNodes(node, options) {
.forEach(checkRes => {
checkRes.relatedNodes = checkRes.relatedNodes.map(relatedNode => {
var res = {
html: relatedNode.source
html: relatedNode?.source ?? 'Undefined'
Copy link
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.

None yet

3 participants