Skip to content

Commit c064710

Browse files
committed
Fix label check when label does not exist
Ref: #279
1 parent a30f085 commit c064710

File tree

1 file changed

+3
-1
lines changed
  • Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5

1 file changed

+3
-1
lines changed

Standards/WCAG2AAA/Sniffs/Principle2/Guideline2_5/2_5_3.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle2_Guideline2_5_2_5_3 = {
6161
} else {
6262
var refNode = top.getElementById(labelFor);
6363
}
64-
accessibleName = HTMLCS.util.getAccessibleName(refNode, top);
64+
if (refNode) {
65+
accessibleName = HTMLCS.util.getAccessibleName(refNode, top);
66+
}
6567
}
6668
break;
6769
case "input":

0 commit comments

Comments
 (0)