Fixed possible crash while searching the steam-path

This commit is contained in:
DarthAffe committed 2016-06-04 10:16:04 +02:00
1 parent 526bc2661a
commit 2c9dc821e5
1 file changed
+2 -3
+2 -3
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;