diff --git a/src/Tasks/GenerateRegistryPassThrough.cs b/src/Tasks/GenerateRegistryPassThrough.cs index bb1f5fb..c1f0174 100644 --- a/src/Tasks/GenerateRegistryPassThrough.cs +++ b/src/Tasks/GenerateRegistryPassThrough.cs @@ -40,11 +40,13 @@ public class GenerateRegistryPassThrough : PoloniumTask .DescendantNodes() .OfType() .FirstOrDefault(cls => cls.Identifier.Text == "PoloniumRegistry"); - IEnumerable properties = clas!.Members + IEnumerable properties = clas?.Members .OfType() .Where(m => m.AttributeLists .SelectMany(a => a.Attributes) .Any(a => a.Name.ToString() == "RegistryPassThrough")); + if (properties is null) + return false; foreach (PropertyDeclarationSyntax property in properties) { if (HasGetterOnly(property))