From dc4d2b124d87d0b48ec082da26a2e9ee4fa3731b Mon Sep 17 00:00:00 2001 From: Ian Ricketson Date: Thu, 28 Dec 2023 13:18:21 -0700 Subject: [PATCH] Return early when value is null --- lib/Doctrine/Validator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/Validator.php b/lib/Doctrine/Validator.php index bab8fe82c..75e63dbbb 100644 --- a/lib/Doctrine/Validator.php +++ b/lib/Doctrine/Validator.php @@ -89,7 +89,7 @@ public function validateRecord(Doctrine_Record $record) */ public static function validateLength($value, $type, $maximumLength) { - if ($maximumLength === null ) { + if ($maximumLength === null || $value === null) { return true; } if ($type == 'timestamp' || $type == 'integer' || $type == 'enum') {