Skip to content

Commit

Permalink
fix: check if preset is in presetsCDN (#291)
Browse files Browse the repository at this point in the history
avoid <url>/undefined head link
fix #290
  • Loading branch information
mseele authored Apr 26, 2020
1 parent 681db4b commit 57a0ceb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ const presetsCDN = {
export type IconPreset = keyof typeof presetsCDN

export default function setupIcons (this: ModuleThis, preset: IconPreset) {
this.options.head!.link!.push({
rel: 'stylesheet',
type: 'text/css',
href: presetsCDN[preset]
})
if (presetsCDN[preset]) {
this.options.head!.link!.push({
rel: 'stylesheet',
type: 'text/css',
href: presetsCDN[preset]
})
}
}

0 comments on commit 57a0ceb

Please sign in to comment.