Added safety checks to the SteamHandler

This commit is contained in:
erri120 2019-12-14 22:34:55 +01:00
parent 75b68e4095
commit 86d91a3e4b
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135

View File

@ -92,7 +92,8 @@ namespace Wabbajack.Common
if (!l.Contains("BaseInstallFolder_")) return;
var s = GetVdfValue(l);
s = Path.Combine(s, "steamapps");
paths.Add(s);
if(Directory.Exists(s))
paths.Add(s);
});
// Default path in the Steam folder isn't in the configs
@ -111,7 +112,7 @@ namespace Wabbajack.Common
InstallFolders.Do(p =>
{
Directory.EnumerateFiles(p, "*.acf", SearchOption.TopDirectoryOnly).Do(f =>
Directory.EnumerateFiles(p, "*.acf", SearchOption.TopDirectoryOnly).Where(File.Exists).Do(f =>
{
var steamGame = new SteamGame();
var valid = false;
@ -157,7 +158,7 @@ namespace Wabbajack.Common
if(!Directory.Exists(workshop))
return;
Directory.EnumerateFiles(workshop, "*.acf", SearchOption.TopDirectoryOnly).Do(f =>
Directory.EnumerateFiles(workshop, "*.acf", SearchOption.TopDirectoryOnly).Where(File.Exists).Do(f =>
{
if (Path.GetFileName(f) != $"appworkshop_{game.AppId}.acf")
return;