summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
Diffstat (limited to 'framework')
-rw-r--r--framework/Web/UI/WebControls/TBaseValidator.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php
index 1f1d0b1b..e3fc8b2f 100644
--- a/framework/Web/UI/WebControls/TBaseValidator.php
+++ b/framework/Web/UI/WebControls/TBaseValidator.php
@@ -92,6 +92,7 @@ abstract class TBaseValidator extends TLabel implements IValidator
* @var boolean
*/
private $_isValid=true;
+ private $_registered=false;
public function __construct()
{
@@ -103,11 +104,14 @@ abstract class TBaseValidator extends TLabel implements IValidator
{
parent::onInit($param);
$this->getPage()->getValidators()->add($this);
+ $this->_registered=true;
}
protected function onUnload($param)
{
- $this->getPage()->getValidators()->remove($this);
+ if($this->_registered && ($page=$this->getPage())!==null)
+ $page->getValidators()->remove($this);
+ $this->_registered=false;
parent::onUnload($param);
}