diff --git a/CHANGELOG.md b/CHANGELOG.md index 092183ae..b8b265f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ### Changelog +#### Version - 3.0.2.1 - 10/19/2022 +* HOTFIX: make game detection more safe against crashes + #### Version - 3.0.2.0 - 10/19/2022 * Show Modlist readmes after install * Basic support for commandline options in the WPF app diff --git a/Wabbajack.Downloaders.GameFile/GameLocator.cs b/Wabbajack.Downloaders.GameFile/GameLocator.cs index 5b6a356b..cae55118 100644 --- a/Wabbajack.Downloaders.GameFile/GameLocator.cs +++ b/Wabbajack.Downloaders.GameFile/GameLocator.cs @@ -139,34 +139,65 @@ public class GameLocator : IGameLocator { var metaData = game.MetaData(); - foreach (var id in metaData.SteamIDs) + try { - if (!_steamGames.TryGetValue(id, out var found)) continue; - path = found; - return true; + foreach (var id in metaData.SteamIDs) + { + if (!_steamGames.TryGetValue(id, out var found)) continue; + path = found; + return true; + } } - - foreach (var id in metaData.GOGIDs) + catch (Exception ex) { - if (!_gogGames.TryGetValue(id, out var found)) continue; - path = found; - return true; + _logger.LogInformation(ex, "During Steam detection"); } - foreach (var id in metaData.EpicGameStoreIDs) + + try { - if (!_egsGames.TryGetValue(id, out var found)) continue; - path = found; - return true; + foreach (var id in metaData.GOGIDs) + { + if (!_gogGames.TryGetValue(id, out var found)) continue; + path = found; + return true; + } + } + catch (Exception ex) + { + _logger.LogInformation(ex, "During GOG detection"); } - foreach (var id in metaData.OriginIDs) + + try { - if (!_originGames.TryGetValue(id, out var found)) continue; - path = found; - return true; + foreach (var id in metaData.EpicGameStoreIDs) + { + if (!_egsGames.TryGetValue(id, out var found)) continue; + path = found; + return true; + } } - + catch (Exception ex) + { + _logger.LogInformation(ex, "During Epic detection"); + } + + + try + { + foreach (var id in metaData.OriginIDs) + { + if (!_originGames.TryGetValue(id, out var found)) continue; + path = found; + return true; + } + } + catch (Exception ex) + { + _logger.LogInformation(ex, "During Origin Store detection"); + } + path = default; return false; }