Fix IDE0019

This commit is contained in:
RoosterDragon
2023-02-19 10:07:30 +00:00
committed by Pavel Penev
parent 80bb828fe5
commit 6d7c73d498
4 changed files with 6 additions and 9 deletions

View File

@@ -34,12 +34,8 @@ namespace OpenRA.Mods.Common.Installer
var prefixes = new[] { "HKEY_LOCAL_MACHINE\\Software\\", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\" };
foreach (var prefix in prefixes)
{
var installDir = Registry.GetValue($"{prefix}GOG.com\\Games\\{appId.Value}", "path", null) as string;
if (installDir != null)
if (Registry.GetValue($"{prefix}GOG.com\\Games\\{appId.Value}", "path", null) is string installDir)
return installDir;
}
return null;
}