Skip to content

Commit 2469b3b

Browse files
committed
[fix] Handle possibly empty strings instead of null
1 parent 9a0142e commit 2469b3b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ConstraintViolationException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ public function getExtensions(): array
4646
{
4747
$extensions = [];
4848
$code = $this->violation->getCode();
49-
if ($code !== null) {
49+
if (! empty($code)) {
5050
$extensions['code'] = $code;
5151
}
5252

5353
$propertyPath = $this->violation->getPropertyPath();
54-
if ($propertyPath !== null) {
54+
if (! empty($propertyPath)) {
5555
$extensions['field'] = $propertyPath;
5656
}
5757

0 commit comments

Comments
 (0)