mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Error when finding the game with no path
This commit is contained in:
parent
4f4d8c487b
commit
d64afea6ab
@ -40,7 +40,7 @@ namespace Wabbajack.Common.StoreHandlers
|
||||
|
||||
foreach (var game in handler.Games)
|
||||
{
|
||||
Utils.Log($"{handler.StoreType}: Found game {game}");
|
||||
Utils.Log($"{handler.StoreType}: Found game {game} at \"{game.Path}\"");
|
||||
_storeGames.Add(game);
|
||||
}
|
||||
}
|
||||
@ -86,9 +86,10 @@ namespace Wabbajack.Common.StoreHandlers
|
||||
|
||||
public AbsolutePath? TryGetGamePath(Game game)
|
||||
{
|
||||
if (Games.TryGetValue(game, out var storeGame))
|
||||
return (AbsolutePath) storeGame.Path;
|
||||
return null;
|
||||
if (!Games.TryGetValue(game, out var storeGame))
|
||||
return null;
|
||||
|
||||
return (AbsolutePath)storeGame.Path;
|
||||
}
|
||||
|
||||
public static void Warmup()
|
||||
|
@ -65,6 +65,12 @@ namespace Wabbajack.Lib
|
||||
if (GameFolder == null)
|
||||
GameFolder = Game.TryGetGameLocation();
|
||||
|
||||
if (GameFolder is { Exists: false })
|
||||
{
|
||||
Utils.Error($"Located game {Game.HumanFriendlyGameName} at \"{GameFolder.Value}\" but the folder does not exist!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GameFolder == null)
|
||||
{
|
||||
var otherGame = Game.CommonlyConfusedWith.Where(g => g.MetaData().IsInstalled).Select(g => g.MetaData()).FirstOrDefault();
|
||||
|
Loading…
Reference in New Issue
Block a user