From 1caa98e342981a92fdc2569bec432387e84a1b67 Mon Sep 17 00:00:00 2001 From: MistaOmega Date: Sat, 5 Oct 2024 19:01:13 +0100 Subject: [PATCH] Validate the installed_json file exists before parsing --- src/GameFinder.Launcher.Heroic/HeroicGOGHandler.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/GameFinder.Launcher.Heroic/HeroicGOGHandler.cs b/src/GameFinder.Launcher.Heroic/HeroicGOGHandler.cs index b4adf7f..154c0b7 100644 --- a/src/GameFinder.Launcher.Heroic/HeroicGOGHandler.cs +++ b/src/GameFinder.Launcher.Heroic/HeroicGOGHandler.cs @@ -52,6 +52,12 @@ public override IEnumerable> 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) {