From 2c9dc821e5b2f619cd8d6f57203f5fd64fc16067 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Sat, 4 Jun 2016 10:16:04 +0200 Subject: [PATCH] Fixed possible crash while searching the steam-path --- Artemis/Artemis/Utilities/GeneralHelpers.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Artemis/Artemis/Utilities/GeneralHelpers.cs b/Artemis/Artemis/Utilities/GeneralHelpers.cs index 627a0bb00..8dc160b6e 100644 --- a/Artemis/Artemis/Utilities/GeneralHelpers.cs +++ b/Artemis/Artemis/Utilities/GeneralHelpers.cs @@ -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;