Skip to content

Commit

Permalink
Fix crash in SteamHandler with missing library
Browse files Browse the repository at this point in the history
  • Loading branch information
Nutzzz committed Mar 11, 2024
1 parent 3c163ad commit 106cb68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/GameFinder.StoreHandlers.Steam/Models/LibraryFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public sealed record LibraryFolder
/// </summary>
public Size GetFreeSpaceEstimate() => TotalDiskSize - GetTotalSizeOfInstalledApps();

private static readonly RelativePath SteamAppsDirectoryName = "steamapps".ToRelativePath();
public static readonly RelativePath SteamAppsDirectoryName = "steamapps".ToRelativePath();

/// <summary>
/// Returns an enumerable for every <c>appmanifest_*.acf</c> file path in the current library.
Expand Down
3 changes: 2 additions & 1 deletion src/GameFinder.StoreHandlers.Steam/SteamHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ public override IEnumerable<OneOf<SteamGame, ErrorMessage>> FindAllGames()
foreach (var libraryFolder in libraryFolders)
{
var libraryFolderPath = libraryFolder.Path;
if (!_fileSystem.DirectoryExists(libraryFolderPath))
if (!_fileSystem.DirectoryExists(libraryFolderPath) ||
!_fileSystem.DirectoryExists(libraryFolderPath.Combine(Models.LibraryFolder.SteamAppsDirectoryName)))
{
yield return new ErrorMessage($"Steam Library at {libraryFolderPath} doesn't exist!");
continue;
Expand Down

0 comments on commit 106cb68

Please sign in to comment.