Skip to content

Commit 3fbae7a

Browse files
authored
Merge pull request #1346 from ConductionNL/fix/patch-null-guard-object-service-mapper-adapter
fix: guard against null return from find() in PATCH path of updateFromArray
2 parents b1a06a5 + f476207 commit 3fbae7a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/Service/ObjectServiceMapperAdapter.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,12 @@ public function updateFromArray(
179179
register: $this->register,
180180
schema: $this->schema
181181
);
182-
$object = array_merge($existing->getObject(), $object);
182+
if ($existing === null) {
183+
throw new ValidationException(
184+
message: sprintf('Object "%s" not found or not accessible', $id)
185+
);
186+
}
187+
$object = array_merge($existing->getObject(), $object);
183188
}
184189

185190
return $this->objectService->saveObject(

0 commit comments

Comments
 (0)