summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModLoading
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-05-09 12:19:30 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-05-09 12:19:30 -0400
commit4ac04ee3aca00f7c1e105ddabd1ed16995b17086 (patch)
tree96f3d9b6ba0629889a9d82285751eee283556ed7 /src/SMAPI/Framework/ModLoading
parent7c76c5cad2c6edac75d6387dbaa5999295be46d8 (diff)
downloadSMAPI-4ac04ee3aca00f7c1e105ddabd1ed16995b17086.tar.gz
SMAPI-4ac04ee3aca00f7c1e105ddabd1ed16995b17086.tar.bz2
SMAPI-4ac04ee3aca00f7c1e105ddabd1ed16995b17086.zip
fix error if a mod has a 'Dependencies' entry with no ID
Diffstat (limited to 'src/SMAPI/Framework/ModLoading')
-rw-r--r--src/SMAPI/Framework/ModLoading/ModMetadata.cs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/SMAPI/Framework/ModLoading/ModMetadata.cs b/src/SMAPI/Framework/ModLoading/ModMetadata.cs
index b703f74c..0ace084f 100644
--- a/src/SMAPI/Framework/ModLoading/ModMetadata.cs
+++ b/src/SMAPI/Framework/ModLoading/ModMetadata.cs
@@ -195,7 +195,7 @@ namespace StardewModdingAPI.Framework.ModLoading
/// <inheritdoc />
public IEnumerable<UpdateKey> GetUpdateKeys(bool validOnly = false)
{
- if (this.Manifest == null)
+ if (!this.HasManifest())
yield break;
foreach (string rawKey in this.Manifest.UpdateKeys)
@@ -254,14 +254,17 @@ namespace StardewModdingAPI.Framework.ModLoading
{
var ids = new Dictionary<string, bool>(StringComparer.OrdinalIgnoreCase);
- if (this.Manifest != null)
+ if (this.HasManifest())
{
// yield dependencies
foreach (IManifestDependency entry in this.Manifest.Dependencies)
- ids[entry.UniqueID] = entry.IsRequired;
+ {
+ if (!string.IsNullOrWhiteSpace(entry.UniqueID))
+ ids[entry.UniqueID] = entry.IsRequired;
+ }
// yield content pack parent
- if (this.Manifest.ContentPackFor?.UniqueID != null)
+ if (!string.IsNullOrWhiteSpace(this.Manifest.ContentPackFor?.UniqueID))
ids[this.Manifest.ContentPackFor.UniqueID] = true;
}