From 11ee11274ebbf1e4bdfe6beb3a6526c29d565475 Mon Sep 17 00:00:00 2001 From: Brian Lima Date: Sun, 18 Sep 2022 18:18:19 -0300 Subject: [PATCH] Check if icon exists before copying --- UWPHook/GamesWindow.xaml.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/UWPHook/GamesWindow.xaml.cs b/UWPHook/GamesWindow.xaml.cs index 569a295..3bca14b 100644 --- a/UWPHook/GamesWindow.xaml.cs +++ b/UWPHook/GamesWindow.xaml.cs @@ -542,7 +542,14 @@ namespace UWPHook string dest_file = String.Join(String.Empty, icons_path, app.Aumid + Path.GetFileName(icon_to_copy)); try { - File.Copy(icon_to_copy, dest_file, true); + if (File.Exists(icon_to_copy)) + { + File.Copy(icon_to_copy, dest_file, true); + } + else + { + dest_file = app.Icon; + } } catch (System.IO.IOException e) {