From b19380e25cbb4bf52436a621b66135f0d5583bfb Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Mon, 6 Nov 2023 15:21:18 +0900 Subject: [PATCH] Don't confuse nullish and falsey #9917 --- .../natural/src/lib/modules/common/services/seo.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/natural/src/lib/modules/common/services/seo.service.ts b/projects/natural/src/lib/modules/common/services/seo.service.ts index 0ba37e86..4b518b19 100644 --- a/projects/natural/src/lib/modules/common/services/seo.service.ts +++ b/projects/natural/src/lib/modules/common/services/seo.service.ts @@ -207,7 +207,7 @@ export class NaturalSeoService { // Canonical // Add language in url (after domain) if some languages are provided only const language = this.config.languages?.length && this.locale ? this.locale.split('-')[0] : ''; - const urlParts = this.getUrlParts(seo.canonicalQueryParamsWhitelist || []); + const urlParts = this.getUrlParts(seo.canonicalQueryParamsWhitelist ?? []); this.updateLinkTag({rel: 'canonical', href: this.getUrl(urlParts, language)}); this.updateAlternates(urlParts); } @@ -290,7 +290,7 @@ export class NaturalSeoService { private updateLinkTag(definition: NaturalLinkDefinition): void { const linkElement = - this.document.head.querySelector(this.parseSelector(definition)) || + this.document.head.querySelector(this.parseSelector(definition)) ?? this.document.head.appendChild(this.document.createElement('link')); if (linkElement) {