* @throws NullPointerException If recovery of requested value instance failed
*/
public function prefetchValueInstance ($registryKey, $extraKey = null) {
- // Get the required instance
- $this->valueInstance = Registry::getRegistry()->getInstance($registryKey);
+ try {
+ // Get the required instance
+ $this->valueInstance = Registry::getRegistry()->getInstance($registryKey);
+ } catch (NullPointerException $e) {
+ // Not set in registry
+ // @TODO Try to log it here
+ }
// Is the value instance valid?
if (is_null($this->valueInstance)) {
$extraInstance = Registry::getRegistry()->getInstance($extraKey);
} // END - if
- // Get the requested instance
try {
+ // Get the requested instance
$this->valueInstance = ObjectFactory::createObjectByConfiguredName($registryKey . '_class', array($extraInstance));
-
} catch (FrameworkException $e) {
// Okay, nothing found so throw a null pointer exception here
throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);