From 11560381bc4d04da16a97ad7079d10d00f157c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Dillenbourg?= Date: Wed, 27 Mar 2024 17:21:21 +0100 Subject: [PATCH] Ensure property exist before assignation --- src/JsonMapperHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JsonMapperHelper.php b/src/JsonMapperHelper.php index 355867f..9b1c585 100644 --- a/src/JsonMapperHelper.php +++ b/src/JsonMapperHelper.php @@ -21,7 +21,7 @@ public static function setUndefinedProperty($object, $propName, $jsonValue) $object->{$propName} = $jsonValue; $object->customFields[$propName] = $jsonValue; } - } else { + } elseif(isset($object->{$propName})) { $object->{$propName} = $jsonValue; } }