Fix the off-chance that someone has a property without a getter

This commit is contained in:
Joe4evr
2017-06-24 02:56:57 +02:00
parent 34917a35de
commit cc390f03de

View File

@@ -58,7 +58,7 @@ namespace Discord.Commands
{
foreach (var prop in ownerType.DeclaredProperties)
{
if (!prop.GetMethod.IsStatic && 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();