diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-02-04 16:50:09 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-02-04 16:50:09 -0500 |
commit | 99d0450b2cb291d565cb836de9f132ca657472c1 (patch) | |
tree | 7a512675a8a9f7f06af1562b078f25a12ea18b62 /src | |
parent | 9c9833c9086b758589dafee10243e3bf47e12d73 (diff) | |
download | SMAPI-99d0450b2cb291d565cb836de9f132ca657472c1.tar.gz SMAPI-99d0450b2cb291d565cb836de9f132ca657472c1.tar.bz2 SMAPI-99d0450b2cb291d565cb836de9f132ca657472c1.zip |
fix install error when the mods folder doesn't exist (#229)
Diffstat (limited to 'src')
-rw-r--r-- | src/StardewModdingAPI.Installer/InteractiveInstaller.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/StardewModdingAPI.Installer/InteractiveInstaller.cs b/src/StardewModdingAPI.Installer/InteractiveInstaller.cs index 5abcfc8f..551c648c 100644 --- a/src/StardewModdingAPI.Installer/InteractiveInstaller.cs +++ b/src/StardewModdingAPI.Installer/InteractiveInstaller.cs @@ -80,8 +80,11 @@ namespace StardewModdingApi.Installer // obsolete yield return installPath("Mods/.cache"); // 1.3-1.4 yield return installPath("StardewModdingAPI-settings.json"); // 1.0-1.4 - foreach (DirectoryInfo modDir in modsDir.EnumerateDirectories()) - yield return Path.Combine(modDir.FullName, ".cache"); // 1.4–1.7 + if (modsDir.Exists) + { + foreach (DirectoryInfo modDir in modsDir.EnumerateDirectories()) + yield return Path.Combine(modDir.FullName, ".cache"); // 1.4–1.7 + } } /// <summary>Whether the current console supports color formatting.</summary> |