Fix type error in resolveIcon

pull/287/head
Amio 2019-06-12 10:48:22 +08:00
rodzic 0508503614
commit 2013033643
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -39,7 +39,7 @@ type ResolvedIcon = {
width?: string
}
function resolveIcon (icon: string, width: string): ResolvedIcon {
function resolveIcon (icon: string | undefined, width: string): ResolvedIcon {
const builtinIcon = icons[icon]
if (builtinIcon) {
return {
@ -48,7 +48,7 @@ function resolveIcon (icon: string, width: string): ResolvedIcon {
}
}
if (icon.startsWith('https://')) {
if (String(icon).startsWith('https://')) {
return { src: icon, width }
}