From 710bb8939683867190c621a914b08e3e3a55bc43 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Mon, 8 Jun 2009 00:27:07 +0000 Subject: [PATCH] BUGFIX #3814 bgribaudo: Don't throw an error on validation if no validator set git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78560 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/Form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'; }