fix error if a mod has a 'Dependencies' entry with no ID
This commit is contained in:
parent
7c76c5cad2
commit
4ac04ee3ac
|
@ -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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue