From 59a25a12ffdb90c5a9a3db90be933ca4e76eb64f Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 12 Dec 2017 01:09:43 -0500 Subject: validate interface is public (#409) --- src/SMAPI/Framework/ModHelpers/ModRegistryHelper.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/SMAPI/Framework/ModHelpers') diff --git a/src/SMAPI/Framework/ModHelpers/ModRegistryHelper.cs b/src/SMAPI/Framework/ModHelpers/ModRegistryHelper.cs index 68201d9a..d39c885c 100644 --- a/src/SMAPI/Framework/ModHelpers/ModRegistryHelper.cs +++ b/src/SMAPI/Framework/ModHelpers/ModRegistryHelper.cs @@ -72,7 +72,12 @@ namespace StardewModdingAPI.Framework.ModHelpers // validate if (!typeof(TInterface).IsInterface) { - this.Monitor.Log("Tried to map a mod-provided API into a class; must be an interface."); + this.Monitor.Log("Tried to map a mod-provided API to a class; must be a public interface.", LogLevel.Error); + return null; + } + if (!typeof(TInterface).IsPublic) + { + this.Monitor.Log("Tried to map a mod-provided API to a non-public interface; must be a public interface.", LogLevel.Error); return null; } -- cgit