Skip to content

Commit

Permalink
Handled when the textContent is passed into the isDescriptiveText fun…
Browse files Browse the repository at this point in the history
…ction as undefined or null in the link-text plugin. This fixes the error "Unable to get property 'replace' of undefined or null reference"
  • Loading branch information
jasonruesch authored and jdan committed Jul 22, 2015
1 parent 3c0f257 commit de2534f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/link-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ class LinkTextPlugin extends Plugin {
* Original: https://github.com/GoogleChrome/accessibility-developer-tools/blob/9183b21cb0a02f5f04928f5cb7cb339b6bbc9ff8/src/audits/LinkWithUnclearPurpose.js#L55-67
*/
isDescriptiveText(textContent) {
// Handle when the text is undefined or null
if (typeof textContent === "undefined" || textContent === null) {
return false;
}

let stopWords = [
"click", "tap", "go", "here", "learn", "more", "this", "page",
"link", "about"
Expand Down

0 comments on commit de2534f

Please sign in to comment.