summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release-notes.md3
-rw-r--r--src/StardewModdingAPI/ModHelper.cs6
2 files changed, 4 insertions, 5 deletions
diff --git a/release-notes.md b/release-notes.md
index bede8849..1c0409ea 100644
--- a/release-notes.md
+++ b/release-notes.md
@@ -8,6 +8,9 @@ For players:
* Fixed issue where SMAPI couldn't be launched from Steam for some Linux players.
* Updated list of incompatible mods.
+For mod developers:
+* Fixed error when reading a custom JSON file from a directory that doesn't exist.
+
For SMAPI developers:
* Added support for specifying a lower bound in mod incompatibility data.
* Added support for custom incompatible-mod-version error text.
diff --git a/src/StardewModdingAPI/ModHelper.cs b/src/StardewModdingAPI/ModHelper.cs
index 7989be74..7304c5ea 100644
--- a/src/StardewModdingAPI/ModHelper.cs
+++ b/src/StardewModdingAPI/ModHelper.cs
@@ -76,11 +76,7 @@ namespace StardewModdingAPI
{
json = File.ReadAllText(fullPath);
}
- catch (FileNotFoundException)
- {
- return null;
- }
- catch (DirectoryNotFoundException)
+ catch (Exception ex) when (ex is DirectoryNotFoundException || ex is FileNotFoundException)
{
return null;
}