projects
/
yaffs-website
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website]
/
web
/
core
/
modules
/
file
/
src
/
Plugin
/
Validation
/
Constraint
/
FileValidationConstraintValidator.php
diff --git
a/web/core/modules/file/src/Plugin/Validation/Constraint/FileValidationConstraintValidator.php
b/web/core/modules/file/src/Plugin/Validation/Constraint/FileValidationConstraintValidator.php
index 972aa69767ddc23fb2c757105e344432bea45166..a6da920c669762428b29ae828301d320e7f153c3 100644
(file)
--- a/
web/core/modules/file/src/Plugin/Validation/Constraint/FileValidationConstraintValidator.php
+++ b/
web/core/modules/file/src/Plugin/Validation/Constraint/FileValidationConstraintValidator.php
@@
-15,7
+15,12
@@
class FileValidationConstraintValidator extends ConstraintValidator {
*/
public function validate($value, Constraint $constraint) {
// Get the file to execute validators.
*/
public function validate($value, Constraint $constraint) {
// Get the file to execute validators.
- $file = $value->get('entity')->getTarget()->getValue();
+ $target = $value->get('entity')->getTarget();
+ if (!$target) {
+ return;
+ }
+
+ $file = $target->getValue();
// Get the validators.
$validators = $value->getUploadValidators();
// Checks that a file meets the criteria specified by the validators.
// Get the validators.
$validators = $value->getUploadValidators();
// Checks that a file meets the criteria specified by the validators.