summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModLoading/ModMetadata.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-05-09 12:12:03 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-05-09 12:12:03 -0400
commit4b391d631ccde301969ae0c04f407a01ba4055b1 (patch)
tree2c5d9317dd3b64731739aaeb64235cde00c8a948 /src/SMAPI/Framework/ModLoading/ModMetadata.cs
parentd9c001a39f4562038fb608468169ea22cf074111 (diff)
downloadSMAPI-4b391d631ccde301969ae0c04f407a01ba4055b1.tar.gz
SMAPI-4b391d631ccde301969ae0c04f407a01ba4055b1.tar.bz2
SMAPI-4b391d631ccde301969ae0c04f407a01ba4055b1.zip
normalize manifest array fields
Diffstat (limited to 'src/SMAPI/Framework/ModLoading/ModMetadata.cs')
-rw-r--r--src/SMAPI/Framework/ModLoading/ModMetadata.cs19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/SMAPI/Framework/ModLoading/ModMetadata.cs b/src/SMAPI/Framework/ModLoading/ModMetadata.cs
index 17e6d59a..b703f74c 100644
--- a/src/SMAPI/Framework/ModLoading/ModMetadata.cs
+++ b/src/SMAPI/Framework/ModLoading/ModMetadata.cs
@@ -195,7 +195,10 @@ namespace StardewModdingAPI.Framework.ModLoading
/// <inheritdoc />
public IEnumerable<UpdateKey> GetUpdateKeys(bool validOnly = false)
{
- foreach (string rawKey in this.Manifest?.UpdateKeys ?? new string[0])
+ if (this.Manifest == null)
+ yield break;
+
+ foreach (string rawKey in this.Manifest.UpdateKeys)
{
UpdateKey updateKey = UpdateKey.Parse(rawKey);
if (updateKey.LooksValid || !validOnly)
@@ -251,16 +254,16 @@ namespace StardewModdingAPI.Framework.ModLoading
{
var ids = new Dictionary<string, bool>(StringComparer.OrdinalIgnoreCase);
- // yield dependencies
- if (this.Manifest?.Dependencies != null)
+ if (this.Manifest != null)
{
- foreach (var entry in this.Manifest?.Dependencies)
+ // yield dependencies
+ foreach (IManifestDependency entry in this.Manifest.Dependencies)
ids[entry.UniqueID] = entry.IsRequired;
- }
- // yield content pack parent
- if (this.Manifest?.ContentPackFor?.UniqueID != null)
- ids[this.Manifest.ContentPackFor.UniqueID] = true;
+ // yield content pack parent
+ if (this.Manifest.ContentPackFor?.UniqueID != null)
+ ids[this.Manifest.ContentPackFor.UniqueID] = true;
+ }
return ids;
}