From e714ede34e224053e26662de1cbff09b66154d1c Mon Sep 17 00:00:00 2001 From: Andreas Date: Tue, 3 Aug 2021 22:58:50 +0200 Subject: [PATCH] Fix crash on start up if there is a libraryfolders.vdf file with the new format and which does not contain a 'mounted' key --- SteamShutdown/Steam.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SteamShutdown/Steam.cs b/SteamShutdown/Steam.cs index c82f118..e47c898 100644 --- a/SteamShutdown/Steam.cs +++ b/SteamShutdown/Steam.cs @@ -220,8 +220,9 @@ private static string[] GetLibraryPaths(string installationPath) // but multiple values: path, label, mounted, contentid // If a library folder is removed in the Steam settings, the path persists, but its 'mounted' value is set to 0 (disabled) - // We consider only the value '1' as that the path is actually enabled. - if (pathNode["mounted"].ToString() != "1") + // We consider only the value '1' as that the path is actually enabled. If this key is not there, it's semantic is that it is mounted. + dynamic mountedNode = pathNode["mounted"]; + if (mountedNode != null && mountedNode.ToString() != "1") continue; pathNode = pathNode["path"];