diff --git a/source/UninstallTools/Factory/SteamFactory.cs b/source/UninstallTools/Factory/SteamFactory.cs index 9434c78f..7d6f59a0 100644 --- a/source/UninstallTools/Factory/SteamFactory.cs +++ b/source/UninstallTools/Factory/SteamFactory.cs @@ -102,7 +102,7 @@ public IList GetUninstallerEntries( public void Setup(ICollection allUninstallers) { } public IEnumerable FindJunk(ApplicationUninstallerEntry target) { - if (target.UninstallerKind != UninstallerType.Steam) + if (target.UninstallerKind != UninstallerType.Steam || string.IsNullOrEmpty(target.InstallLocation)) return Enumerable.Empty(); var results = new List(); @@ -110,7 +110,7 @@ public IEnumerable FindJunk(ApplicationUninstallerEntry target) { // Look for this appID in steam library's temporary folders (game is inside "common" folder, temp folders are next to that) var d = new DirectoryInfo(target.InstallLocation); - if (d.Parent?.Name == "common" && d.Parent.Parent != null) + if (d.Exists && d.Parent?.Name == "common" && d.Parent.Parent != null) { var libraryDir = d.Parent.Parent.FullName; Debug.Assert(target.RatingId.StartsWith("Steam App ")); @@ -133,11 +133,7 @@ public IEnumerable FindJunk(ApplicationUninstallerEntry target) } } - catch (SecurityException e) - { - Console.WriteLine(e); - } - catch (IOException e) + catch (SystemException e) { Console.WriteLine(e); }