From 4cdaea4747e3825215630e2490a974d80e2552be Mon Sep 17 00:00:00 2001 From: Fraser Waters Date: Wed, 4 Oct 2017 11:35:26 +0100 Subject: [PATCH] Fix bug in Rewrite that didn't detect missing CountAttributes --- src/Generator.Rewrite/Program.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Generator.Rewrite/Program.cs b/src/Generator.Rewrite/Program.cs index f3a809b8..40040029 100644 --- a/src/Generator.Rewrite/Program.cs +++ b/src/Generator.Rewrite/Program.cs @@ -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"));