From 3c46bdaeb3e9b484f9f93754e74fe4b30c2d7eaf Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 14 May 2023 16:10:59 -0400 Subject: [PATCH] fix install error if a game folder has an invalid symlink --- docs/release-notes.md | 1 + src/SMAPI.Toolkit/Framework/GameScanning/GameScanner.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index c957484a..34090bf8 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -11,6 +11,7 @@ * For players: * In multiplayer, the game/SMAPI window titles now show whether you're the main player or a farmhand. * Fixed logged SMAPI errors not having line numbers on Linux/macOS. + * Fixed install error if a game folder has an invalid symlink. * For mod authors: * Fixed error loading a mod if it sets `"MinimumApiVersion": null` explicitly. diff --git a/src/SMAPI.Toolkit/Framework/GameScanning/GameScanner.cs b/src/SMAPI.Toolkit/Framework/GameScanning/GameScanner.cs index 88142805..45f3e203 100644 --- a/src/SMAPI.Toolkit/Framework/GameScanning/GameScanner.cs +++ b/src/SMAPI.Toolkit/Framework/GameScanning/GameScanner.cs @@ -73,7 +73,7 @@ namespace StardewModdingAPI.Toolkit.Framework.GameScanning return GameFolderType.NoGameFound; // apparently valid - if (dir.EnumerateFiles("Stardew Valley.dll").Any()) + if (File.Exists(Path.Combine(dir.FullName, "Stardew Valley.dll"))) return GameFolderType.Valid; // doesn't contain any version of Stardew Valley