Prevent exception when scanning origin lib

This commit is contained in:
Nils Goetje
2021-04-29 16:48:24 +02:00
parent 0b8117d39b
commit 2bffdbc098
2 changed files with 7 additions and 1 deletions

View File

@ -472,6 +472,12 @@ namespace DisplayMagician.GameLibraries
// Now we want to look in the dinstallpath location for the game info
// for the __Installer\installerdata.xml
if (String.IsNullOrEmpty(originGame.GameInstallDir))
{
// then we have a problem and we need to continue and ignore this game
logger.Warn($"OriginLibrary/LoadInstalledGames: Origin game with ID {originGame.GameID} has registry but we can't find install dir!");
continue;
}
string gameInstallerData = Path.Combine(originGame.GameInstallDir, @"__Installer", @"installerdata.xml");
@ -603,7 +609,6 @@ namespace DisplayMagician.GameLibraries
// If we reach here we add the Game to the list of games we have!
_allOriginGames.Add(new OriginGame(originGame.GameID, originGame.GameName, originGame.GameExePath, originGame.GameIconPath));
}
else
{

View File

@ -600,6 +600,7 @@ namespace DisplayMagician.GameLibraries
}
else
{
gotGameRegistryKey = false;
logger.Trace($"UplayLibrary/LoadInstalledGames: Game with uplayEntryLines[{i}]: '{uplayEntryLines[i]}' not found");
}
}