Skip to content

Commit bd171fd

Browse files
Jack251970jjw24
authored andcommitted
Merge pull request #3973 from dcog989/bookmark-quick-fix
Bookmark plugin - catch an exception for empty / broken favicons
1 parent a08d7cc commit bd171fd

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Helper/FaviconHelper.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,13 @@ public static byte[] TryConvertToWebp(byte[] data)
106106
{
107107
try
108108
{
109-
using (var image = SKImage.FromBitmap(bitmap))
110-
using (var webp = image.Encode(SKEncodedImageFormat.Webp, 65))
111-
{
112-
if (webp != null)
113-
return webp.ToArray();
114-
}
109+
using var image = SKImage.FromBitmap(bitmap);
110+
if (image is null)
111+
return null;
112+
113+
using var webp = image.Encode(SKEncodedImageFormat.Webp, 65);
114+
if (webp != null)
115+
return webp.ToArray();
115116
}
116117
finally
117118
{

0 commit comments

Comments
 (0)