Skip to content

Commit

Permalink
Validate the installed_json file exists before parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
MistaOmega committed Oct 5, 2024
1 parent 2fce4fb commit 1caa98e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/GameFinder.Launcher.Heroic/HeroicGOGHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ public override IEnumerable<OneOf<GOGGame, ErrorMessage>> FindAllGames()

var installedJsonFile = GetInstalledJsonFilePath(configDirectory);

if (!installedJsonFile.FileExists)
{
yield return new ErrorMessage($"Didn't find the installed.json file in `{configDirectory}`. This can be ignored if you haven't signed into GOG on Heroic yet.");
yield break;
}

var games = ParseInstalledJsonFile(installedJsonFile, configDirectory);
foreach (var x in games)
{
Expand Down

0 comments on commit 1caa98e

Please sign in to comment.