Browse Source

Merge pull request #717 from Joe4evr/FixPropertyInjection

Fix attempting to inject into static properties
tags/1.0
Christopher F GitHub 8 years ago
parent
commit
a396a1cb1c
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
{
foreach (var prop in ownerType.DeclaredProperties)
{
if (prop.SetMethod?.IsPublic == true && prop.GetCustomAttribute<DontInjectAttribute>() == null)
if (prop.GetMethod?.IsStatic == false && prop.SetMethod?.IsPublic == true && prop.GetCustomAttribute<DontInjectAttribute>() == null)
result.Add(prop);
}
ownerType = ownerType.BaseType.GetTypeInfo();


Loading…
Cancel
Save