diff --git a/src/metatags/handler.js b/src/metatags/handler.js index dbc5b718..ede03e84 100644 --- a/src/metatags/handler.js +++ b/src/metatags/handler.js @@ -77,7 +77,7 @@ export default async function auditMetaTags(message, context) { for (const [pageUrl, pageTags] of Object.entries(extractedTags)) { seoChecks.performChecks(pageUrl, pageTags); } - seoChecks.organizeDetectedTags(); + seoChecks.finalChecks(); const detectedTags = seoChecks.getDetectedTags(); // Prepare Audit result const auditResult = { diff --git a/src/metatags/seo-checks.js b/src/metatags/seo-checks.js index 41dc78c6..90892b3e 100644 --- a/src/metatags/seo-checks.js +++ b/src/metatags/seo-checks.js @@ -73,8 +73,8 @@ class SeoChecks { if (tagContent === '') { this.detectedTags[tagName][EMPTY_TAGS] ??= { pageUrls: [] }; this.detectedTags[tagName][EMPTY_TAGS].pageUrls.push(url); - } else if (tagContent.length > TAG_LENGTHS[tagName].maxLength - || tagContent.length < TAG_LENGTHS[tagName].minLength) { + } else if (tagContent?.length > TAG_LENGTHS[tagName].maxLength + || tagContent?.length < TAG_LENGTHS[tagName].minLength) { this.detectedTags[tagName][LENGTH_CHECK_FAIL_TAGS] ??= {}; this.detectedTags[tagName][LENGTH_CHECK_FAIL_TAGS].url = url; this.detectedTags[tagName][LENGTH_CHECK_FAIL_TAGS].tagContent = tagContent;