From 125f9e5358c09a9a52efc64848c42338a9c3d529 Mon Sep 17 00:00:00 2001 From: jygaulier Date: Tue, 3 Dec 2024 10:48:07 +0100 Subject: [PATCH] allow empty definition --- .../ValidRenditionDefinitionConstraintValidator.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/databox/api/src/Validator/ValidRenditionDefinitionConstraintValidator.php b/databox/api/src/Validator/ValidRenditionDefinitionConstraintValidator.php index 6578cccca..0bb44994f 100644 --- a/databox/api/src/Validator/ValidRenditionDefinitionConstraintValidator.php +++ b/databox/api/src/Validator/ValidRenditionDefinitionConstraintValidator.php @@ -24,8 +24,11 @@ public function __construct(private readonly YamlLoader $yamlLoader, private rea */ public function validate($value, Constraint $constraint): void { + if(!($definition = $value->getDefinition())) { + return; + } try { - $config = $this->yamlLoader->parse($value->getDefinition()); + $config = $this->yamlLoader->parse($definition); $this->validator->validate($config); } catch (\Throwable $e) { $this->context