Browse Source

Fix validator

Guillermo Espinoza 8 years ago
parent
commit
a5a6158cd3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Validator/JSONValidator.php

+ 1 - 1
Validator/JSONValidator.php

@@ -14,7 +14,7 @@ class JSONValidator
      */
     public static function validate($value, ExecutionContextInterface $context, $payload)
     {
-        if (isset($payload['field'])) {
+        if (isset($payload['field']) && $value) {
             json_decode($value);
             if (json_last_error() !== JSON_ERROR_NONE) {
                 $context->buildViolation('error.json_format_invalid')