Skip to content

Commit a8ba9b4

Browse files
committed
fix: Catch weather icon rendering failures
1 parent bf10c37 commit a8ba9b4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/plugins/weatherIcons/index.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ export const weatherIcons: Plugin = {
4444
svg = iconImageCache.get(iconName) as HTMLImageElement
4545
}
4646

47-
ctx.drawImage(svg, pixel - iconWidth / 2, i % 2 ? 10 : iconWidth + 2, iconWidth, iconWidth)
47+
try {
48+
ctx.drawImage(svg, pixel - iconWidth / 2, i % 2 ? 10 : iconWidth + 2, iconWidth, iconWidth)
49+
} catch (error) {
50+
console.error('Failed to draw weather icon:', { error, svg })
51+
}
4852
})
4953
},
5054

0 commit comments

Comments
 (0)