[+TASK] Extbase (Object): Make sure the class info cache is returning valid objects
authorFranz Koch <typo3@elements-net.de>
Wed, 1 Dec 2010 12:30:08 +0000 (12:30 +0000)
committerFranz Koch <typo3@elements-net.de>
Wed, 1 Dec 2010 12:30:08 +0000 (12:30 +0000)
typo3/sysext/extbase/Classes/Object/Container/Container.php

index 5de5cfe..62e5d92 100644 (file)
@@ -245,7 +245,9 @@ class Tx_Extbase_Object_Container_Container {
         * @return Tx_Extbase_Object_Container_ClassInfo
         */
        private function getClassInfo($className) {
-               if (!$this->cache->has($className)) {
+                       // we also need to make sure that the cache is returning a vaild object
+                       // in case something went wrong with unserialization etc.. 
+               if (!$this->cache->has($className) || !is_object($this->cache->get($className))) {
                        $this->cache->set($className, $this->classInfoFactory->buildClassInfoFromClassName($className));
                }
                return $this->cache->get($className);