Ensure injected properties have public setters

This commit is contained in:
james7132
2017-02-11 20:12:12 +00:00
parent 145ae1518b
commit 73f00eb0d7

View File

@@ -20,7 +20,7 @@ namespace Discord.Commands
var constructor = constructors[0];
System.Reflection.ParameterInfo[] parameters = constructor.GetParameters();
System.Reflection.PropertyInfo[] properties = typeInfo.DeclaredProperties
.Where(p => p.CanWrite && p.GetCustomAttribute<DontInjectAttribute>() == null)
.Where(p => p.SetMethod?.IsPublic == true && p.GetCustomAttribute<DontInjectAttribute>() == null)
.ToArray();
return (map) =>