Merge pull request #717 from Joe4evr/FixPropertyInjection

Fix attempting to inject into static properties
This commit is contained in:
Christopher F
2017-06-24 06:47:30 -04:00
committed by GitHub

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();