From 35ba5cc58510a754b9377e33ebf01e3c2731d31e Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 8 Mar 2021 00:05:58 -0500 Subject: fix installer error when Mods folder doesn't exist in 3.9.3 (#764) --- docs/release-notes.md | 4 ++++ src/SMAPI.Toolkit/Utilities/PathUtilities.cs | 3 +++ 2 files changed, 7 insertions(+) diff --git a/docs/release-notes.md b/docs/release-notes.md index ed03b3db..6112f99c 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -7,6 +7,10 @@ * Migrated to Harmony 2.0 (see [_migrate to Harmony 2.0_](https://stardewvalleywiki.com/Modding:Migrate_to_Harmony_2.0) for more info). --> +## Upcoming release +* For players: + * Fixed installer error if the `Mods` folder doesn't exist in 3.9.3. + ## 3.9.3 Released 07 March 2021 for Stardew Valley 1.5.4 or later. diff --git a/src/SMAPI.Toolkit/Utilities/PathUtilities.cs b/src/SMAPI.Toolkit/Utilities/PathUtilities.cs index a394edba..babc0981 100644 --- a/src/SMAPI.Toolkit/Utilities/PathUtilities.cs +++ b/src/SMAPI.Toolkit/Utilities/PathUtilities.cs @@ -139,6 +139,9 @@ namespace StardewModdingAPI.Toolkit.Utilities /// The root path to search. internal static IEnumerable GetTooLongPaths(string rootPath) { + if (!Directory.Exists(rootPath)) + return new string[0]; + return Directory .EnumerateFileSystemEntries(rootPath, "*.*", SearchOption.AllDirectories) .Where(PathUtilities.IsPathTooLong); -- cgit