From c064710a2cd35add88f67e28d135d181c5e12a25 Mon Sep 17 00:00:00 2001 From: Anthony Barnes Date: Tue, 14 Apr 2020 08:11:49 +1000 Subject: [PATCH] Fix label check when label does not exist Ref: #279 --- Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_3.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_3.js b/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_3.js index 773e9b80..ba9178ce 100644 --- a/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_3.js +++ b/Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_3.js @@ -61,7 +61,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_5_2_5_3 = { } else { var refNode = top.getElementById(labelFor); } - accessibleName = HTMLCS.util.getAccessibleName(refNode, top); + if (refNode) { + accessibleName = HTMLCS.util.getAccessibleName(refNode, top); + } } break; case "input":