summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-08-22 01:36:11 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-08-22 01:36:11 -0400
commitd2b6a71aa4cc3383d55350e346e27c1ab2ff134b (patch)
tree5f1e6001c32258cfdd8a3463660298151ebb037b
parent5374b216ca62959db384ed243ac51e6209bc2abc (diff)
downloadSMAPI-d2b6a71aa4cc3383d55350e346e27c1ab2ff134b.tar.gz
SMAPI-d2b6a71aa4cc3383d55350e346e27c1ab2ff134b.tar.bz2
SMAPI-d2b6a71aa4cc3383d55350e346e27c1ab2ff134b.zip
fix crash when a mod manifest is corrupted
-rw-r--r--docs/release-notes.md1
-rw-r--r--src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs2
2 files changed, 2 insertions, 1 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 3ce7d6bb..34f7404e 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -5,6 +5,7 @@
* Moved most SMAPI files into a `smapi-internal` subfolder.
* Moved save backups into a `save-backups` subfolder (instead of `Mods/SaveBackup/backups`). Note that previous backups will be deleted when you update.
* Fixed installer duplicating bundled mods if you moved them after the last install.
+ * Fixed crash when a mod manifest is corrupted.
* Updated compatibility list.
* For modders:
diff --git a/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs b/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs
index 71dc0cb3..7512d5cb 100644
--- a/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs
+++ b/src/StardewModdingAPI.Toolkit/Framework/ModScanning/ModScanner.cs
@@ -64,7 +64,7 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning
{
try
{
- if (!this.JsonHelper.ReadJsonFileIfExists<Manifest>(manifestFile.FullName, out manifest))
+ if (!this.JsonHelper.ReadJsonFileIfExists<Manifest>(manifestFile.FullName, out manifest) || manifest == null)
manifestError = "its manifest is invalid.";
}
catch (SParseException ex)