Skip to content

Commit

Permalink
Check for null message
Browse files Browse the repository at this point in the history
  • Loading branch information
awurth committed Apr 1, 2023
1 parent cd7b5e2 commit 915c41d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Assertion/Asserter.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public function assert(mixed $subject, ValidationInterface $validation, array $m
try {
$validation->getRules()->assert($subject);
} catch (NestedValidationException $exception) {
if ($message = $validation->getMessage()) {
$message = $validation->getMessage();
if (null !== $message) {
$failures->add(
$this->validationFailureFactory->create($message, $subject, $validation->getProperty())
);
Expand Down

0 comments on commit 915c41d

Please sign in to comment.