Browse Source

Fix detection of IDependencyMap impl

Not pretty, but it works.
tags/1.0-rc
Khionu Sybiern 8 years ago
parent
commit
df6579260e
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/Discord.Net.Commands/Utilities/ReflectionUtils.cs

+ 1
- 1
src/Discord.Net.Commands/Utilities/ReflectionUtils.cs View File

@@ -58,7 +58,7 @@ namespace Discord.Commands
{ {
if (targetType == typeof(CommandService)) if (targetType == typeof(CommandService))
arg = service; arg = service;
else if (targetType == typeof(IDependencyMap))
else if (targetType.GetTypeInfo().ImplementedInterfaces.Contains(typeof(IDependencyMap)))
arg = map; arg = map;
else else
throw new InvalidOperationException($"Failed to create \"{baseType.FullName}\", dependency \"{targetType.Name}\" was not found."); throw new InvalidOperationException($"Failed to create \"{baseType.FullName}\", dependency \"{targetType.Name}\" was not found.");


Loading…
Cancel
Save