summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-03-11 21:07:45 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-03-11 21:07:45 -0400
commitf0e1a46f0fa52b4365c8ccb64c7fe4784002257b (patch)
tree74c8dee2a7b62fd4aec4f1e026d4957a773025be
parent98fa9f03891e3dc487bee6dcb3756e6251c67aef (diff)
downloadSMAPI-f0e1a46f0fa52b4365c8ccb64c7fe4784002257b.tar.gz
SMAPI-f0e1a46f0fa52b4365c8ccb64c7fe4784002257b.tar.bz2
SMAPI-f0e1a46f0fa52b4365c8ccb64c7fe4784002257b.zip
fix error when content pack needs a mod that couldn't be loaded
-rw-r--r--docs/release-notes.md1
-rw-r--r--src/SMAPI/Program.cs2
2 files changed, 2 insertions, 1 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 7297fb59..1e32eb8d 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -14,6 +14,7 @@
* Fixed rare crash with some combinations of manifest fields and internal mod data.
* Fixed update checks failing for Nexus Mods due to a change in their API.
* Fixed update checks failing for some older mods with non-standard versions.
+ * Fixed error when a content pack needs a mod that couldn't be loaded.
* Updated compatibility list and added update checks for more mods.
* For the [log parser][]:
diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs
index e713add5..4bd40710 100644
--- a/src/SMAPI/Program.cs
+++ b/src/SMAPI/Program.cs
@@ -854,7 +854,7 @@ namespace StardewModdingAPI
// log loaded content packs
if (loadedContentPacks.Any())
{
- string GetModDisplayName(string id) => loadedMods.First(p => id != null && id.Equals(p.Manifest?.UniqueID, StringComparison.InvariantCultureIgnoreCase))?.DisplayName;
+ string GetModDisplayName(string id) => loadedMods.FirstOrDefault(p => id != null && id.Equals(p.Manifest?.UniqueID, StringComparison.InvariantCultureIgnoreCase))?.DisplayName;
this.Monitor.Log($"Loaded {loadedContentPacks.Length} content packs:", LogLevel.Info);
foreach (IModMetadata metadata in loadedContentPacks.OrderBy(p => p.DisplayName))