From 48ad31afee1d88ca3c3beaf73136ffb7d9c5c74c Mon Sep 17 00:00:00 2001 From: Nice3point Date: Thu, 9 May 2024 00:19:02 +0300 Subject: [PATCH] Fix unreadable properties --- .../RevitLookup/Core/Engine/DescriptorBuilder.Properties.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/RevitLookup/Core/Engine/DescriptorBuilder.Properties.cs b/source/RevitLookup/Core/Engine/DescriptorBuilder.Properties.cs index c81eeae4..7b2dae2d 100644 --- a/source/RevitLookup/Core/Engine/DescriptorBuilder.Properties.cs +++ b/source/RevitLookup/Core/Engine/DescriptorBuilder.Properties.cs @@ -33,7 +33,7 @@ private void AddProperties(BindingFlags bindingFlags) if (member.IsSpecialName) continue; object value; - var parameters = member.GetMethod!.GetParameters(); + var parameters = member.CanRead ? member.GetMethod!.GetParameters() : null; try { @@ -104,7 +104,7 @@ private bool IsPropertySupported(PropertyInfo member, ParameterInfo[] parameters value = new NotSupportedException("Property does not have a get accessor, it cannot be read"); return true; } - + if (parameters.Length > 0) { if (!_settings.IncludeUnsupported) return false;