From 6a3a4d0fe203a28ebd358154c05d185df15a72ba Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Tue, 23 Jul 2019 15:04:14 +0200 Subject: [PATCH] FIX PHP 7.2 error trying to count null validation result --- code/EditableSpamProtectionField.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/EditableSpamProtectionField.php b/code/EditableSpamProtectionField.php index 8993f28..ca768ec 100644 --- a/code/EditableSpamProtectionField.php +++ b/code/EditableSpamProtectionField.php @@ -215,7 +215,7 @@ if (class_exists('EditableFormField')) { $foundError = false; // field validate implementation may not add error to validator - if (count($errors) > 0) { + if ($errors && count($errors) > 0) { // check if error already added from fields' validate method foreach ($errors as $error) { if ($error['fieldName'] == $this->Name) {