diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index 51d85803b..2cbabaf18 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -3355,11 +3355,11 @@ class Model extends Object implements CakeEventListener { * @return ModelValidator */ public function validator($instance = null) { - if ($validator instanceof ModelValidator) { - return $this->_validator = $validator; + if ($instance instanceof ModelValidator) { + return $this->_validator = $instance; } - if (is_null($validator) && is_null($this->validatorClass)) { + if (is_null($instance) && is_null($this->validatorClass)) { $this->_validator = new ModelValidator($this); }