From 929e2642409ce50efd77f7b27edf30fd3ea769b1 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 26 Jun 2018 18:28:55 -0400 Subject: fix update checks failing when some mods don't have a mod ID --- src/SMAPI/Framework/ModLoading/ModMetadata.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/SMAPI/Framework/ModLoading') diff --git a/src/SMAPI/Framework/ModLoading/ModMetadata.cs b/src/SMAPI/Framework/ModLoading/ModMetadata.cs index 02a77778..3a412009 100644 --- a/src/SMAPI/Framework/ModLoading/ModMetadata.cs +++ b/src/SMAPI/Framework/ModLoading/ModMetadata.cs @@ -133,6 +133,14 @@ namespace StardewModdingAPI.Framework.ModLoading return this.Manifest != null; } + /// Whether the mod has an ID (regardless of whether the ID is valid or the mod itself was loaded). + public bool HasID() + { + return + this.HasManifest() + && !string.IsNullOrWhiteSpace(this.Manifest.UniqueID); + } + /// Whether the mod has at least one update key set. public bool HasUpdateKeys() { -- cgit