summaryrefslogtreecommitdiff
path: root/src/SMAPI.Toolkit/Utilities
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-03-08 00:05:58 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-03-08 00:05:58 -0500
commit35ba5cc58510a754b9377e33ebf01e3c2731d31e (patch)
tree7746d49e2f2ede99d59e46ea4755eb0b6c3bbd5c /src/SMAPI.Toolkit/Utilities
parent00969f3b485fd0637980cb4dd8abead2fe621a3b (diff)
downloadSMAPI-35ba5cc58510a754b9377e33ebf01e3c2731d31e.tar.gz
SMAPI-35ba5cc58510a754b9377e33ebf01e3c2731d31e.tar.bz2
SMAPI-35ba5cc58510a754b9377e33ebf01e3c2731d31e.zip
fix installer error when Mods folder doesn't exist in 3.9.3 (#764)
Diffstat (limited to 'src/SMAPI.Toolkit/Utilities')
-rw-r--r--src/SMAPI.Toolkit/Utilities/PathUtilities.cs3
1 files changed, 3 insertions, 0 deletions
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
/// <param name="rootPath">The root path to search.</param>
internal static IEnumerable<string> GetTooLongPaths(string rootPath)
{
+ if (!Directory.Exists(rootPath))
+ return new string[0];
+
return Directory
.EnumerateFileSystemEntries(rootPath, "*.*", SearchOption.AllDirectories)
.Where(PathUtilities.IsPathTooLong);