From 4abfaf9dfc5b2cec963a558939f2af7e949de659 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 16 Aug 2006 03:28:09 +0000 Subject: [PATCH] We need to return; when we trigger an error --- Loader.php | 4 ++++ Register.php | 3 +++ 2 files changed, 7 insertions(+) diff --git a/Loader.php b/Loader.php index 2bdf9f2..e9403c6 100644 --- a/Loader.php +++ b/Loader.php @@ -115,6 +115,7 @@ class BSLoader if (get_class($register) != 'BSRegister') { trigger_error('BSLoader::SetRegister() was not passed a BSRegister object'); + return; } self::SharedInstance()->main = $register; @@ -136,6 +137,7 @@ class BSLoader if (!isset(self::SharedInstance()->main)) { trigger_error('Cannot fetch the main register because it has not been set with BSLoader::SetRegister()'); + return; } return self::SharedInstance()->main; } @@ -144,6 +146,7 @@ class BSLoader if (!isset(self::SharedInstance()->registers["$index"])) { trigger_error('Invalid register index passed to BSLoader::GetRegister()'); + return; } return self::SharedInstance()->registers["$index"]; } @@ -172,6 +175,7 @@ class BSLoader if (!class_exists($class)) { trigger_error('Specifed module does not conform to the ISSO specification, or the class is missing'); + return } return new $class; diff --git a/Register.php b/Register.php index 961e286..78f455c 100644 --- a/Register.php +++ b/Register.php @@ -203,6 +203,7 @@ class BSRegister if (isset($this->registry["$key"])) { trigger_error('Cannot overwrite a key in the registry'); + return; } $this->registry["$key"] = $value; @@ -220,6 +221,7 @@ class BSRegister if (!isset($this->registry["$key"])) { trigger_error('You cannot unregister a key that does not exist'); + return; } unset($this->registry["$key"]); @@ -238,6 +240,7 @@ class BSRegister if (!isset($this->registry["$key"])) { trigger_error('Cannot access the registry with a non-existent key'); + return; } return $this->registry["$key"]; -- 2.43.5