mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Another SteamHandler null fix for if path was not set during parsing
This commit is contained in:
parent
f9f9646cc8
commit
da440d9dae
@ -131,7 +131,7 @@ namespace Wabbajack.Common.StoreHandlers
|
||||
Directory.EnumerateFiles(u, "*.acf", SearchOption.TopDirectoryOnly).Where(File.Exists).Do(f =>
|
||||
{
|
||||
var game = new SteamGame();
|
||||
var valid = false;
|
||||
var gotID = false;
|
||||
|
||||
File.ReadAllLines(f).Do(l =>
|
||||
{
|
||||
@ -140,6 +140,7 @@ namespace Wabbajack.Common.StoreHandlers
|
||||
if (!int.TryParse(GetVdfValue(l), out var id))
|
||||
return;
|
||||
game.ID = id;
|
||||
gotID = true;
|
||||
}
|
||||
|
||||
if (l.Contains("\"name\""))
|
||||
@ -149,19 +150,17 @@ namespace Wabbajack.Common.StoreHandlers
|
||||
{
|
||||
var path = Path.Combine(u, "common", GetVdfValue(l));
|
||||
if (Directory.Exists(path))
|
||||
{
|
||||
game.Path = path;
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
valid = true;
|
||||
});
|
||||
|
||||
if (!valid) return;
|
||||
if (!gotID || !Directory.Exists(game.Path)) return;
|
||||
|
||||
var gameMeta = GameRegistry.Games.Values.FirstOrDefault(g =>
|
||||
{
|
||||
return g.SteamIDs.Contains(game.ID)
|
||||
return (g.SteamIDs?.Contains(game.ID) ?? false)
|
||||
&& (g.RequiredFiles?.TrueForAll(file => File.Exists(Path.Combine(game.Path, file))) ?? true);
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user