Skip to content

Commit

Permalink
Fix crash on start up if there is a libraryfolders.vdf file with the …
Browse files Browse the repository at this point in the history
…new format and which does not contain a 'mounted' key
  • Loading branch information
akorb committed Aug 3, 2021
1 parent c5655c6 commit e714ede
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions SteamShutdown/Steam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down

0 comments on commit e714ede

Please sign in to comment.