Fix bug in Rewrite that didn't detect missing CountAttributes

This commit is contained in:
Fraser Waters 2017-10-04 11:35:26 +01:00
parent 781cdd5a3b
commit 4cdaea4747

View file

@ -863,9 +863,10 @@ namespace OpenTK.Rewrite
var attribute = parameter.CustomAttributes
.FirstOrDefault(a => a.AttributeType.Name == "CountAttribute");
var count = new CountAttribute();
CountAttribute count = null;
if (attribute != null)
{
count = new CountAttribute();
count.Count = (int)(GetAttributeField(attribute, "Count") ?? 0);
count.Parameter = (string)(GetAttributeField(attribute, "Parameter"));
count.Computed = (string)(GetAttributeField(attribute, "Computed"));