Skip to content

Commit

Permalink
Change from spaces to tabs in PropertyProxyCache
Browse files Browse the repository at this point in the history
  • Loading branch information
AnderssonPeter committed Oct 4, 2024
1 parent 10fe7ee commit cdcdb56
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions SystemTextJsonPatch/Internal/PropertyProxyCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,31 @@ internal static class PropertyProxyCache
{
var jsonPropertyNameAttr = propertyInfo.GetCustomAttribute<JsonPropertyNameAttribute>();
if (jsonPropertyNameAttr != null && string.Equals(jsonPropertyNameAttr.Name, propName, StringComparison.OrdinalIgnoreCase))
{
EnsureAccessToProperty(propertyInfo);
return new PropertyProxy(propertyInfo);
}
}
{
EnsureAccessToProperty(propertyInfo);
return new PropertyProxy(propertyInfo);
}
}

// If it didn't find match by JsonPropertyName then use property name
foreach (var propertyInfo in properties)
{
if (string.Equals(propertyInfo.Name, propName, StringComparison.OrdinalIgnoreCase))
{
EnsureAccessToProperty(propertyInfo);
return new PropertyProxy(propertyInfo);
{
EnsureAccessToProperty(propertyInfo);
return new PropertyProxy(propertyInfo);
}
}

return null;
}

private static void EnsureAccessToProperty(PropertyInfo propertyInfo)
{
if (propertyInfo.GetCustomAttribute(typeof(DenyPatchAttribute), true) != null)
{
throw new JsonPatchAccessDeniedException(propertyInfo);
}
}
}
private static void EnsureAccessToProperty(PropertyInfo propertyInfo)
{
if (propertyInfo.GetCustomAttribute(typeof(DenyPatchAttribute), true) != null)
{
throw new JsonPatchAccessDeniedException(propertyInfo);
}
}
}
}

0 comments on commit cdcdb56

Please sign in to comment.