diff options
author | Tyler <gibbstyler7@gmail.com> | 2022-10-19 10:21:19 -0500 |
---|---|---|
committer | Tyler <gibbstyler7@gmail.com> | 2022-10-19 10:21:19 -0500 |
commit | 55eec58eafb9ba07f3e8b0a1c8394cb114de17a0 (patch) | |
tree | b1e5d0b279baa880814f3093e8c918be511dd63b | |
parent | 61d6ec12daee843f758e5f828a713a72a767a94b (diff) | |
download | SMAPI-55eec58eafb9ba07f3e8b0a1c8394cb114de17a0.tar.gz SMAPI-55eec58eafb9ba07f3e8b0a1c8394cb114de17a0.tar.bz2 SMAPI-55eec58eafb9ba07f3e8b0a1c8394cb114de17a0.zip |
simplify ContentPackFor validation check
-rw-r--r-- | src/SMAPI.Toolkit/Serialization/Models/Manifest.cs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/SMAPI.Toolkit/Serialization/Models/Manifest.cs b/src/SMAPI.Toolkit/Serialization/Models/Manifest.cs index 4f84a60d..1607cf3e 100644 --- a/src/SMAPI.Toolkit/Serialization/Models/Manifest.cs +++ b/src/SMAPI.Toolkit/Serialization/Models/Manifest.cs @@ -134,15 +134,11 @@ namespace StardewModdingAPI.Toolkit.Serialization.Models return false; } - // validate content pack - else if (isContentPack) + // validate content pack ID + else if (isContentPack && string.IsNullOrWhiteSpace(this.ContentPackFor!.UniqueID)) { - // invalid content pack ID - if (string.IsNullOrWhiteSpace(this.ContentPackFor!.UniqueID)) - { - error = $"manifest declares {nameof(IManifest.ContentPackFor)} without its required {nameof(IManifestContentPackFor.UniqueID)} field."; - return false; - } + error = $"manifest declares {nameof(IManifest.ContentPackFor)} without its required {nameof(IManifestContentPackFor.UniqueID)} field."; + return false; } // validate required fields |