diff --git a/Classes/PHPExcel/CachedObjectStorageFactory.php b/Classes/PHPExcel/CachedObjectStorageFactory.php index 849de05a..47776286 100644 --- a/Classes/PHPExcel/CachedObjectStorageFactory.php +++ b/Classes/PHPExcel/CachedObjectStorageFactory.php @@ -125,12 +125,14 @@ class PHPExcel_CachedObjectStorageFactory { public static function getInstance(PHPExcel_Worksheet $parent) { if (is_null(self::$_cacheStorageMethod)) { - self::initialize(); + $cacheMethodIsAvailable = self::initialize(); } - $instance = new self::$_cacheStorageClass($parent,self::$_storageMethodParameters[self::$_cacheStorageMethod]); - if (!is_null($instance)) { - return $instance; + if ($cacheMethodIsAvailable) { + $instance = new self::$_cacheStorageClass($parent,self::$_storageMethodParameters[self::$_cacheStorageMethod]); + if (!is_null($instance)) { + return $instance; + } } return false;