]> git.mxchange.org Git - core.git/commitdiff
NPE catched (TODO: We need to rewrite this?)
authorRoland Häder <roland@mxchange.org>
Fri, 21 Aug 2009 22:11:16 +0000 (22:11 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 21 Aug 2009 22:11:16 +0000 (22:11 +0000)
inc/classes/main/helper/web/forms/class_WebFormHelper.php

index 815db8d9c03d7468cacb40ab2784994e3be6eefc..b91f646adba48305fbe3ee1ebe344a27d15ba925 100644 (file)
@@ -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));