* @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));