From 8896c11e43942062b42bc1de79119fdfebf91320 Mon Sep 17 00:00:00 2001 From: Arthur van de Vondervoort Date: Thu, 14 Dec 2023 09:52:18 +0100 Subject: [PATCH] Resolve 'System.InvalidCastException' exception --- Design/Rule0044AnalyzeTransferField.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Design/Rule0044AnalyzeTransferField.cs b/Design/Rule0044AnalyzeTransferField.cs index 7acd7496..ccfd8013 100644 --- a/Design/Rule0044AnalyzeTransferField.cs +++ b/Design/Rule0044AnalyzeTransferField.cs @@ -718,7 +718,7 @@ public void PopulateFields(IApplicationObjectTypeSymbol table) public void PopulateFields(FieldExtensionListSyntax fieldList) { - foreach (FieldSyntax field in fieldList.Fields) + foreach (FieldSyntax field in fieldList.Fields.Where(fld => fld.IsKind(SyntaxKind.Field))) { if (!FieldIsObsolete(field)) Fields.Add(new Field((int)field.No.Value, field.Name.Identifier.ToString().Replace("\"", ""), field.Type.ToString(), field.GetLocation(), this));