Skip to content

Commit 3bd6906

Browse files
committed
Validate iconPath exists
1 parent 49d5cd3 commit 3bd6906

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ private static unsafe HBITMAP GetHBitmapForUrlFile(string fileName, int width, i
133133
var urlSection = data["InternetShortcut"];
134134

135135
var iconPath = urlSection?["IconFile"];
136-
if (string.IsNullOrEmpty(iconPath))
136+
if (!File.Exists(iconPath))
137137
{
138+
// If the IconFile is missing, throw exception to fallback to the default icon
138139
throw new FileNotFoundException("Icon file not specified in Internet shortcut (.url) file.");
139140
}
140141
hBitmap = GetHBitmap(Path.GetFullPath(iconPath), width, height, options);

0 commit comments

Comments
 (0)