diff --git a/src/coverlet.core/Instrumentation/Instrumenter.cs b/src/coverlet.core/Instrumentation/Instrumenter.cs index 4ccea7002..f49e40bec 100644 --- a/src/coverlet.core/Instrumentation/Instrumenter.cs +++ b/src/coverlet.core/Instrumentation/Instrumenter.cs @@ -279,7 +279,7 @@ private void InstrumentType(TypeDefinition type) if (actualMethod.IsGetter || actualMethod.IsSetter) { - PropertyDefinition prop = type.Properties.FirstOrDefault(p => p.GetMethod.FullName.Equals(actualMethod.FullName)); + PropertyDefinition prop = type.Properties.FirstOrDefault(p => (p.GetMethod ?? p.SetMethod).FullName.Equals(actualMethod.FullName)); if (prop?.HasCustomAttributes == true) customAttributes = customAttributes.Union(prop.CustomAttributes); }