Skip to content

Commit e1f1fe7

Browse files
authored
fix null reference in GetAllBreakingChangeAttributesInType (#410)
1 parent 0309635 commit e1f1fe7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Common/CustomAttributes/BreakingChangeAttributeHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ public static IEnumerable<GenericBreakingChangeWithVersionAttribute> GetAllBreak
155155
attributeList.AddRange(f.GetCustomAttributes(typeof(GenericBreakingChangeWithVersionAttribute), false).Cast<GenericBreakingChangeWithVersionAttribute>());
156156
}
157157

158-
foreach (ParameterMetadata param in invocationInfo.MyCommand.Parameters.Values)
158+
foreach (ParameterMetadata param in invocationInfo?.MyCommand?.Parameters?.Values)
159159
{
160160
attributeList.AddRange(param.Attributes.Where(a => a is GenericBreakingChangeWithVersionAttribute).Select(a => a as GenericBreakingChangeWithVersionAttribute));
161161
}
162162

163163
return invocationInfo == null ? attributeList : attributeList.Where(e => e.IsApplicableToInvocation(invocationInfo));
164164
}
165165
}
166-
}
166+
}

0 commit comments

Comments
 (0)