From a3692644b4cc7eb45cc6ca00c72f8f1b75b95d6e Mon Sep 17 00:00:00 2001 From: Nathan Chere Date: Thu, 12 Oct 2017 10:53:49 +0200 Subject: [PATCH] Add safeguard to prevent trying to register abstract modules --- Superscribe.WebAPI/SuperscribeConfig.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Superscribe.WebAPI/SuperscribeConfig.cs b/Superscribe.WebAPI/SuperscribeConfig.cs index 64adc08..6ea3ba7 100644 --- a/Superscribe.WebAPI/SuperscribeConfig.cs +++ b/Superscribe.WebAPI/SuperscribeConfig.cs @@ -25,7 +25,9 @@ public static IRouteEngine RegisterModules(HttpConfiguration configuration, IRou var modules = (from assembly in AppDomain.CurrentDomain.GetAssemblies() from type in assembly.GetTypes() - where typeof(SuperscribeModule).IsAssignableFrom(type) && type != typeof(SuperscribeModule) + where !type.IsAbstract + && typeof(SuperscribeModule).IsAssignableFrom(type) + && type != typeof(SuperscribeModule) select new { Type = type }).ToList(); foreach (var module in modules)