Skip to content

Commit

Permalink
Don't confuse nullish and falsey #9917
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerKiKi committed Nov 6, 2023
1 parent e58d3ac commit b19380e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -290,7 +290,7 @@ export class NaturalSeoService {

private updateLinkTag(definition: NaturalLinkDefinition): void {
const linkElement =
this.document.head.querySelector<HTMLLinkElement>(this.parseSelector(definition)) ||
this.document.head.querySelector<HTMLLinkElement>(this.parseSelector(definition)) ??
this.document.head.appendChild(this.document.createElement('link'));

if (linkElement) {
Expand Down

0 comments on commit b19380e

Please sign in to comment.