Validate iconPath exists

This commit is contained in:
Spencer Stream 2025-09-23 07:19:39 -05:00
parent 49d5cd36df
commit 3bd6906c80

View file

@ -133,8 +133,9 @@ namespace Flow.Launcher.Infrastructure.Image
var urlSection = data["InternetShortcut"];
var iconPath = urlSection?["IconFile"];
if (string.IsNullOrEmpty(iconPath))
if (!File.Exists(iconPath))
{
// If the IconFile is missing, throw exception to fallback to the default icon
throw new FileNotFoundException("Icon file not specified in Internet shortcut (.url) file.");
}
hBitmap = GetHBitmap(Path.GetFullPath(iconPath), width, height, options);