From d8920550e524b1515d30da9a2d45b807782ab789 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 21 Aug 2009 22:11:16 +0000 Subject: [PATCH] NPE catched (TODO: We need to rewrite this?) --- .../main/helper/web/forms/class_WebFormHelper.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/inc/classes/main/helper/web/forms/class_WebFormHelper.php b/inc/classes/main/helper/web/forms/class_WebFormHelper.php index 815db8d9..b91f646a 100644 --- a/inc/classes/main/helper/web/forms/class_WebFormHelper.php +++ b/inc/classes/main/helper/web/forms/class_WebFormHelper.php @@ -672,8 +672,16 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { * @return void */ public function addCaptcha () { - // Get last executed pre filter - $extraInstance = Registry::getRegistry()->getInstance('extra'); + // Init instance + $extraInstance = null; + + try { + // Get last executed pre filter + $extraInstance = Registry::getRegistry()->getInstance('extra'); + } catch (NullPointerException $e) { + // Instance in registry is not set (null) + // @TODO We need to log this later + } // Get a configured instance $captchaInstance = ObjectFactory::createObjectByConfiguredName($this->getFormName().'_captcha', array($this, $extraInstance)); -- 2.39.5