From 67c8307ca7bea61b9039096396e65213ee42d995 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..4f736bd 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; } }