mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Added safety checks to the SteamHandler
This commit is contained in:
@ -92,7 +92,8 @@ namespace Wabbajack.Common
|
|||||||
if (!l.Contains("BaseInstallFolder_")) return;
|
if (!l.Contains("BaseInstallFolder_")) return;
|
||||||
var s = GetVdfValue(l);
|
var s = GetVdfValue(l);
|
||||||
s = Path.Combine(s, "steamapps");
|
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
|
// Default path in the Steam folder isn't in the configs
|
||||||
@ -111,7 +112,7 @@ namespace Wabbajack.Common
|
|||||||
|
|
||||||
InstallFolders.Do(p =>
|
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 steamGame = new SteamGame();
|
||||||
var valid = false;
|
var valid = false;
|
||||||
@ -157,7 +158,7 @@ namespace Wabbajack.Common
|
|||||||
if(!Directory.Exists(workshop))
|
if(!Directory.Exists(workshop))
|
||||||
return;
|
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")
|
if (Path.GetFileName(f) != $"appworkshop_{game.AppId}.acf")
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user