Merge pull request #95 from DarthAffe/bugfix

Fixed possible crash while searching the steam-path
This commit is contained in:
Robert Beekman committed 2016-06-04 11:13:28 +02:00
commit 0033b8b982
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;