diff --git a/forms/Form.php b/forms/Form.php index 665f5b6dc..f1f3b84fe 100644 --- a/forms/Form.php +++ b/forms/Form.php @@ -540,7 +540,7 @@ class Form extends RequestHandler { $attributes['enctype'] = $this->FormEncType(); if($this->target) $attributes['target'] = $this->target; if($this->extraClass()) $attributes['class'] = $this->extraClass(); - if($this->validator->getErrors()) { + if($this->validator && $this->validator->getErrors()) { if(!isset($attributes['class'])) $attributes['class'] = ''; $attributes['class'] .= ' validationerror'; }