1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Merge pull request #95 from DarthAffe/bugfix

Fixed possible crash while searching the steam-path
This commit is contained in:
Robert Beekman 2016-06-04 11:13:28 +02:00
commit 0033b8b982

View File

@ -129,10 +129,9 @@ namespace Artemis.Utilities
public static string FindSteamGame(string relativePath)
{
var key = Registry.CurrentUser.OpenSubKey(@"Software\Valve\Steam");
if (key == null)
var path = Registry.CurrentUser.OpenSubKey(@"Software\Valve\Steam")?.GetValue("SteamPath")?.ToString();
if (path == null)
return null;
var path = key.GetValue("SteamPath").ToString();
var libFile = path + @"\steamapps\libraryfolders.vdf";
if (!File.Exists(libFile))
return null;