diff --git a/lib/checks/color/link-in-text-block-evaluate.js b/lib/checks/color/link-in-text-block-evaluate.js index be872cd7..0cb89893 100644 --- a/lib/checks/color/link-in-text-block-evaluate.js +++ b/lib/checks/color/link-in-text-block-evaluate.js @@ -136,6 +136,14 @@ function getColorContrast(node, parentBlock) { nodeColor = getForegroundColor(node); parentColor = getForegroundColor(parentBlock); + if (!nodeColor) { + nodeColor = new axe.commons.color.Color(0, 0, 0, 0); + } + + if (!parentColor) { + parentColor = new axe.commons.color.Color(0, 0, 0, 0); + } + if (!nodeColor || !parentColor) { return undefined; }