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

Fixed possible crash while searching the steam-path

This commit is contained in:
Darth Affe 2016-06-04 10:16:04 +02:00
parent 526bc2661a
commit 2c9dc821e5

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;