Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Commit

Permalink
return if value is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasartack committed Mar 17, 2017
1 parent 0d3302a commit da37127
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/SwiftmailerEmailValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ class SwiftmailerEmailValidator extends ConstraintValidator
{
public function validate($value, Constraint $constraint)
{
if (null === $value || '' === $value) {
return;
}

$this->grammer = new \Swift_Mime_Grammar();

if (!$this->isValid($value)) {
Expand Down

0 comments on commit da37127

Please sign in to comment.