From 5954470e105faad5f8318b2dee991ca63651e19e Mon Sep 17 00:00:00 2001 From: Mikel Date: Wed, 22 Feb 2023 09:32:36 +0100 Subject: [PATCH] error prevention on non required uploadable files --- Domain/Model/DtoNormalizer.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Domain/Model/DtoNormalizer.php b/Domain/Model/DtoNormalizer.php index e9343d5..b009fba 100755 --- a/Domain/Model/DtoNormalizer.php +++ b/Domain/Model/DtoNormalizer.php @@ -113,7 +113,12 @@ protected function setByContext(array $contextProperties, array $data) foreach ($contextProperties as $key => $value) { if (is_array($value)) { foreach ($value as $property) { - if (!isset($data[$key]) || !is_string($property) || !array_key_exists($property, $data[$key])) { + if ( + !isset($data[$key]) + || !is_string($property) + || !is_array($data[$key]) + || !array_key_exists($property, $data[$key]) + ) { continue; }