Skip to content

Commit 8f8f666

Browse files
authored
Merge pull request #155 from MistaOmega/#154-Validate-installed-json-exists
Validate the installed_json file exists before parsing
2 parents 2fce4fb + 1caa98e commit 8f8f666

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/GameFinder.Launcher.Heroic/HeroicGOGHandler.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ public override IEnumerable<OneOf<GOGGame, ErrorMessage>> FindAllGames()
5252

5353
var installedJsonFile = GetInstalledJsonFilePath(configDirectory);
5454

55+
if (!installedJsonFile.FileExists)
56+
{
57+
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.");
58+
yield break;
59+
}
60+
5561
var games = ParseInstalledJsonFile(installedJsonFile, configDirectory);
5662
foreach (var x in games)
5763
{

0 commit comments

Comments
 (0)