From e472c364e07133a059a5ef55084de4a8f7d99782 Mon Sep 17 00:00:00 2001 From: Vladyslav <89814092+Tudzer@users.noreply.github.com> Date: Sat, 11 Nov 2023 10:36:18 +0200 Subject: [PATCH] Fix ArgumentException when GOG game has no EXE path specified --- GameLib.Plugin/GameLib.Plugin.Gog/GogGameFactory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GameLib.Plugin/GameLib.Plugin.Gog/GogGameFactory.cs b/GameLib.Plugin/GameLib.Plugin.Gog/GogGameFactory.cs index e9c8049..3538d0e 100644 --- a/GameLib.Plugin/GameLib.Plugin.Gog/GogGameFactory.cs +++ b/GameLib.Plugin/GameLib.Plugin.Gog/GogGameFactory.cs @@ -99,7 +99,7 @@ private static GogGame AddExecutables(ILauncher launcher, GogGame game) return null; } - game.InstallDir = Path.GetDirectoryName(game.Executable) ?? string.Empty; + game.InstallDir = string.IsNullOrEmpty(game.Executable) ? string.Empty : Path.GetDirectoryName(game.Executable) ?? string.Empty; game.LaunchString = $"\"{launcher.Executable}\" /command=runGame /gameId={game.Id}"; if (!string.IsNullOrEmpty(game.WorkingDir)) {