From b8580e58aadbbef6f99dfc15ab0fcc38f5210dd8 Mon Sep 17 00:00:00 2001 From: Mark Monteiro Date: Sat, 21 Mar 2020 23:28:27 +0100 Subject: [PATCH] Check for implementation of IService correctly --- Emby.Server.Implementations/Services/ServiceController.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/Services/ServiceController.cs b/Emby.Server.Implementations/Services/ServiceController.cs index 3f9c8778b5..d546317a95 100644 --- a/Emby.Server.Implementations/Services/ServiceController.cs +++ b/Emby.Server.Implementations/Services/ServiceController.cs @@ -8,12 +8,17 @@ using Microsoft.Extensions.Logging; namespace Emby.Server.Implementations.Services { public delegate object ActionInvokerFn(object intance, object request); + public delegate void VoidActionInvokerFn(object intance, object request); public class ServiceController { private readonly ILogger _log; + /// + /// Initializes a new instance of the class. + /// + /// The logger. public ServiceController(ILogger log) { _log = log; @@ -30,7 +35,7 @@ namespace Emby.Server.Implementations.Services public void RegisterService(HttpListenerHost appHost, Type serviceType) { // Make sure the provided type implements IService - if (!serviceType.IsAssignableFrom(typeof(IService))) + if (!typeof(IService).IsAssignableFrom(serviceType)) { _log.LogWarning("Tried to register a service that does not implement IService: {ServiceType}", serviceType); return;