From 6aec6ae5953fd60e71ca0c97b9f730a40078bd36 Mon Sep 17 00:00:00 2001 From: Arthur van de Vondervoort Date: Thu, 14 Dec 2023 11:50:49 +0100 Subject: [PATCH] Resolve System.NullReferenceException --- Design/Rule0044AnalyzeTransferField.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Design/Rule0044AnalyzeTransferField.cs b/Design/Rule0044AnalyzeTransferField.cs index ccfd8013..379a8b33 100644 --- a/Design/Rule0044AnalyzeTransferField.cs +++ b/Design/Rule0044AnalyzeTransferField.cs @@ -718,6 +718,8 @@ public void PopulateFields(IApplicationObjectTypeSymbol table) public void PopulateFields(FieldExtensionListSyntax fieldList) { + if (fieldList == null) return; + foreach (FieldSyntax field in fieldList.Fields.Where(fld => fld.IsKind(SyntaxKind.Field))) { if (!FieldIsObsolete(field)) @@ -727,6 +729,7 @@ public void PopulateFields(FieldExtensionListSyntax fieldList) public void PopulateFields(FieldListSyntax fieldList) { + if (fieldList == null) return; foreach (FieldSyntax field in fieldList.Fields) {