diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 23b3df13..a68e1aa5 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -1124,7 +1124,8 @@ namespace CppSharp.Generators.CSharp GeneratePropertyGetter(prop.GetMethod, @class); if (prop.HasSetter) - GeneratePropertySetter(prop.SetMethod.Parameters[0].QualifiedType, + GeneratePropertySetter(prop.GetMethod != null ? + prop.GetMethod.ReturnType : prop.SetMethod.Parameters[0].QualifiedType, prop.SetMethod, @class); }