Skip to content

Commit

Permalink
wip(Liquid.Core): Update Liquid framework for net8 - fixes sonar issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianareginalino committed Jun 17, 2024
1 parent f9bf268 commit 3743530
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Liquid.Core/Extensions/ObjectExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ public static byte[] ToJsonBytes(this object source, JsonSerializerOptions optio
/// <exception cref="ArgumentOutOfRangeException">Couldn't find field {fieldName} in type {objType.FullName}</exception>
public static object GetFieldValue(this object obj, string fieldName)
{
if (obj == null)
throw new ArgumentNullException(nameof(obj));
ArgumentNullException.ThrowIfNull(obj);

Type objType = obj.GetType();
var fieldInfo = TypeUtils.GetFieldInfo(objType, fieldName);
if (fieldInfo == null)
Expand All @@ -258,8 +258,8 @@ public static object GetFieldValue(this object obj, string fieldName)
/// <exception cref="ArgumentOutOfRangeException">Couldn't find field {fieldName} in type {objType.FullName}</exception>
public static void SetFieldValue(this object obj, string fieldName, object val)
{
if (obj == null)
throw new ArgumentNullException(nameof(obj));
ArgumentNullException.ThrowIfNull(obj);

Type objType = obj.GetType();
var fieldInfo = TypeUtils.GetFieldInfo(objType, fieldName);
if (fieldInfo == null)
Expand All @@ -278,8 +278,8 @@ public static void SetFieldValue(this object obj, string fieldName, object val)
/// <exception cref="ArgumentOutOfRangeException">Couldn't find property {propertyName} in type {objType.FullName}</exception>
public static object GetPropertyValue(this object obj, string propertyName)
{
if (obj == null)
throw new ArgumentNullException(nameof(obj));
ArgumentNullException.ThrowIfNull(obj);

Type objType = obj.GetType();
var propertyInfo = TypeUtils.GetPropertyInfo(objType, propertyName);
if (propertyInfo == null)
Expand All @@ -298,8 +298,8 @@ public static object GetPropertyValue(this object obj, string propertyName)
/// <exception cref="ArgumentOutOfRangeException">Couldn't find property {propertyName} in type {objType.FullName}</exception>
public static void SetPropertyValue(this object obj, string propertyName, object val)
{
if (obj == null)
throw new ArgumentNullException(nameof(obj));
ArgumentNullException.ThrowIfNull(obj);

Type objType = obj.GetType();
var propertyInfo = TypeUtils.GetPropertyInfo(objType, propertyName);
if (propertyInfo == null)
Expand Down

0 comments on commit 3743530

Please sign in to comment.