Skip to content

Commit

Permalink
Ignore corrupted Steam shortcuts.vdf files
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Oct 20, 2024
1 parent 91d2d46 commit c3f76f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Core/SteamLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ private static IEnumerable<GameBase> LibraryPathGames(KVSerializer acfParser,

private static IEnumerable<GameBase> ShortcutsFileGames(KVSerializer vdfParser,
string path)
=> vdfParser.Deserialize<List<NonSteamGame>>(File.OpenRead(path))
.Select(nsg => nsg.NormalizeDir(path));
=> Utilities.DefaultIfThrows(() => vdfParser.Deserialize<List<NonSteamGame>>(File.OpenRead(path)))
?.Select(nsg => nsg.NormalizeDir(path))
?? Enumerable.Empty<NonSteamGame>();

private const string registryKey = @"HKEY_CURRENT_USER\Software\Valve\Steam";
private const string registryValue = @"SteamPath";
Expand Down

0 comments on commit c3f76f4

Please sign in to comment.