Skip to content

Commit

Permalink
don't validate file owner if empty value
Browse files Browse the repository at this point in the history
  • Loading branch information
jbouzekri committed Feb 4, 2017
1 parent 2613264 commit 4bd76b6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Service/Validator/Constraints/FileOwnerValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ public function __construct(ObjectManager $em, TokenStorageInterface $tokenStora
*/
public function validate($value, Constraint $constraint)
{
if (!$value) {
return;
}

$fileHistory = $this->em->getRepository('JbFileUploaderBundle:FileHistory')->find($value);
if (!$fileHistory) {
return;
Expand Down

0 comments on commit 4bd76b6

Please sign in to comment.