simplify ContentPackFor validation check

This commit is contained in:
Tyler 2022-10-19 10:21:19 -05:00
parent 61d6ec12da
commit 55eec58eaf
No known key found for this signature in database
GPG Key ID: 76974E65DA9B27D8
1 changed files with 4 additions and 8 deletions

View File

@ -134,16 +134,12 @@ namespace StardewModdingAPI.Toolkit.Serialization.Models
return false;
}
// validate content pack
else if (isContentPack)
{
// invalid content pack ID
if (string.IsNullOrWhiteSpace(this.ContentPackFor!.UniqueID))
// validate content pack ID
else if (isContentPack && string.IsNullOrWhiteSpace(this.ContentPackFor!.UniqueID))
{
error = $"manifest declares {nameof(IManifest.ContentPackFor)} without its required {nameof(IManifestContentPackFor.UniqueID)} field.";
return false;
}
}
// validate required fields
{