Commit e35963e
committed
Skip unsupported icon formats in PackageWrapper.LoadIconAsync
The icon cache (IconCacheEngine.MimeToExtension) writes files in formats
Avalonia's Skia Bitmap cannot decode: SVG, AVIF, ICO, TIFF. Passing such
a file to `new Bitmap(uri.LocalPath)` throws
ArgumentException("Unable to load bitmap from provided data"). The
exception is caught and the failure is cached, but Rider's debugger
surfaces every first-chance throw, so users see a flood of stack traces
whenever the package list brings new rows with non-raster icons into
view (e.g. after typing in the search bar).
Whitelist PNG/JPEG/GIF/BMP/WebP — the formats Skia can actually decode —
and short-circuit unsupported extensions to a cached-null result. The
package falls back to its manager source icon, same as before.1 parent 271ac3e commit e35963e
1 file changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
204 | 211 | | |
205 | 212 | | |
206 | 213 | | |
| |||
223 | 230 | | |
224 | 231 | | |
225 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
226 | 244 | | |
227 | 245 | | |
228 | 246 | | |
| |||
0 commit comments