diff --git a/plugins/link-text/index.js b/plugins/link-text/index.js index b0602adc..f40cce6a 100644 --- a/plugins/link-text/index.js +++ b/plugins/link-text/index.js @@ -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"