Check if icon exists before copying

pull/104/head
Brian Lima 2 years ago
parent faa6b36759
commit 11ee11274e

@ -541,9 +541,16 @@ namespace UWPHook
string dest_file = String.Join(String.Empty, icons_path, app.Aumid + Path.GetFileName(icon_to_copy)); string dest_file = String.Join(String.Empty, icons_path, app.Aumid + Path.GetFileName(icon_to_copy));
try try
{
if (File.Exists(icon_to_copy))
{ {
File.Copy(icon_to_copy, dest_file, true); File.Copy(icon_to_copy, dest_file, true);
} }
else
{
dest_file = app.Icon;
}
}
catch (System.IO.IOException e) catch (System.IO.IOException e)
{ {
Log.Warning(e, "Could not copy icon " + app.Icon); Log.Warning(e, "Could not copy icon " + app.Icon);

Loading…
Cancel
Save