Fix attempting to inject into static properties

This commit is contained in:
Joe4evr
2017-06-24 02:39:02 +02:00
parent ea685b4f23
commit 444868b22d

View File

@@ -58,7 +58,7 @@ namespace Discord.Commands
{ {
foreach (var prop in ownerType.DeclaredProperties) foreach (var prop in ownerType.DeclaredProperties)
{ {
if (prop.SetMethod?.IsPublic == true && prop.GetCustomAttribute<DontInjectAttribute>() == null) if (prop.GetMethod.IsStatic && prop.SetMethod?.IsPublic == true && prop.GetCustomAttribute<DontInjectAttribute>() == null)
result.Add(prop); result.Add(prop);
} }
ownerType = ownerType.BaseType.GetTypeInfo(); ownerType = ownerType.BaseType.GetTypeInfo();