Skip to content

Commit

Permalink
Merge pull request #155 from MistaOmega/#154-Validate-installed-json-…
Browse files Browse the repository at this point in the history
…exists

Validate the installed_json file exists before parsing
  • Loading branch information
erri120 authored Oct 6, 2024
2 parents 2fce4fb + 1caa98e commit 8f8f666
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 8f8f666

Please sign in to comment.