diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-01-14 12:26:59 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-01-14 12:26:59 -0500 |
commit | 34bf9c5ecabce7500423ba0d1cdd3cfaa25f186b (patch) | |
tree | 480b774a5c6c4ac7fdb0a1faa31703637565be12 | |
parent | 482dd42d3d010d4636e86c551db11c5ee8ac470d (diff) | |
download | SMAPI-34bf9c5ecabce7500423ba0d1cdd3cfaa25f186b.tar.gz SMAPI-34bf9c5ecabce7500423ba0d1cdd3cfaa25f186b.tar.bz2 SMAPI-34bf9c5ecabce7500423ba0d1cdd3cfaa25f186b.zip |
tweak JSON read error-handling, update release notes
-rw-r--r-- | release-notes.md | 3 | ||||
-rw-r--r-- | src/StardewModdingAPI/ModHelper.cs | 6 |
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; } |