diff --git a/src/Liquid.Core/Extensions/ObjectExtension.cs b/src/Liquid.Core/Extensions/ObjectExtension.cs
index 2675fe2..0bd33aa 100644
--- a/src/Liquid.Core/Extensions/ObjectExtension.cs
+++ b/src/Liquid.Core/Extensions/ObjectExtension.cs
@@ -238,8 +238,8 @@ public static byte[] ToJsonBytes(this object source, JsonSerializerOptions optio
/// Couldn't find field {fieldName} in type {objType.FullName}
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)
@@ -258,8 +258,8 @@ public static object GetFieldValue(this object obj, string fieldName)
/// Couldn't find field {fieldName} in type {objType.FullName}
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)
@@ -278,8 +278,8 @@ public static void SetFieldValue(this object obj, string fieldName, object val)
/// Couldn't find property {propertyName} in type {objType.FullName}
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)
@@ -298,8 +298,8 @@ public static object GetPropertyValue(this object obj, string propertyName)
/// Couldn't find property {propertyName} in type {objType.FullName}
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)