Skip to content

Commit

Permalink
Check if valid GOG path
Browse files Browse the repository at this point in the history
  • Loading branch information
bcssov committed Sep 10, 2023
1 parent 8bf17db commit 878a27d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created : 02-12-2020
//
// Last Modified By : Mario
// Last Modified On : 06-25-2023
// Last Modified On : 09-10-2023
// ***********************************************************************
// <copyright file="GameRegistration.cs" company="Mario">
// Mario
Expand Down Expand Up @@ -143,7 +143,10 @@ private GameSettings GetExecutableSettings(IGameType game)
if (!File.Exists(path) && game.GogAppId.HasValue)
{
basePath = GogDirectory.GetGameDirectory(game.GogAppId.GetValueOrDefault());
path = Path.Combine(basePath, game.LauncherSettingsFileName);
if (!string.IsNullOrWhiteSpace(basePath))
{
path = Path.Combine(basePath, game.LauncherSettingsFileName);
}
}
if (File.Exists(path))
{
Expand Down
4 changes: 2 additions & 2 deletions src/IronyModManager.Services/Registrations/GogDirectory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created : 07-15-2022
//
// Last Modified By : Mario
// Last Modified On : 05-26-2023
// Last Modified On : 09-10-2023
// ***********************************************************************
// <copyright file="GogDirectory.cs" company="Mario">
// Mario
Expand Down Expand Up @@ -64,7 +64,7 @@ public static string GetGameDirectory(int? appId)
var game = games.FirstOrDefault(p => p.Id == appId.GetValueOrDefault());
if (game != null)
{
return game.Path;
return game.Path ?? string.Empty;
}
}
return string.Empty;
Expand Down

0 comments on commit 878a27d

Please sign in to comment.