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
This commit is contained in:
Sam Minnee 2009-06-08 00:27:07 +00:00
parent c803dd6350
commit 710bb89396

View File

@ -540,7 +540,7 @@ class Form extends RequestHandler {
$attributes['enctype'] = $this->FormEncType(); $attributes['enctype'] = $this->FormEncType();
if($this->target) $attributes['target'] = $this->target; if($this->target) $attributes['target'] = $this->target;
if($this->extraClass()) $attributes['class'] = $this->extraClass(); if($this->extraClass()) $attributes['class'] = $this->extraClass();
if($this->validator->getErrors()) { if($this->validator && $this->validator->getErrors()) {
if(!isset($attributes['class'])) $attributes['class'] = ''; if(!isset($attributes['class'])) $attributes['class'] = '';
$attributes['class'] .= ' validationerror'; $attributes['class'] .= ' validationerror';
} }