Skip to content

Commit

Permalink
Fix unreadable properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Nice3point committed May 8, 2024
1 parent 85ac837 commit 48ad31a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 48ad31a

Please sign in to comment.