Fatal Error on non object in Worksheet.php

the disconnectCells method is not always fully initialized with the attribute 
_cellCollection, so a check needs to be done. Otherwise a fatal error occurs.
happens if multiple xsl are created from csv file
This commit is contained in:
Matthias Laug 2013-02-21 14:35:59 +01:00
parent 3ea55ce287
commit 6ae1a501c5
1 changed files with 4 additions and 3 deletions

View File

@ -378,9 +378,10 @@ class PHPExcel_Worksheet implements PHPExcel_IComparable
*/
public function disconnectCells()
{
$this->_cellCollection->unsetWorksheetCells();
$this->_cellCollection = NULL;
if ( $this->_cellCollection != null ){
$this->_cellCollection->unsetWorksheetCells();
$this->_cellCollection = NULL;
}
// detach ourself from the workbook, so that it can then delete this worksheet successfully
$this->_parent = null;
}