From fe840150778f76a9d8b37f0843942de49bf0a17e Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Sat, 16 Nov 2013 10:38:30 +0000 Subject: [PATCH] On the chance that a cell doesn't have a defined style but it's still trying to be formatted --- Classes/PHPExcel/Worksheet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/PHPExcel/Worksheet.php b/Classes/PHPExcel/Worksheet.php index 24b5e3e8..9d7a5007 100644 --- a/Classes/PHPExcel/Worksheet.php +++ b/Classes/PHPExcel/Worksheet.php @@ -2426,7 +2426,7 @@ class PHPExcel_Worksheet implements PHPExcel_IComparable $style = $this->_parent->getCellXfByIndex($cell->getXfIndex()); $returnValue[$rRef][$cRef] = PHPExcel_Style_NumberFormat::toFormattedString( $returnValue[$rRef][$cRef], - ($style->getNumberFormat()) ? + ($style && $style->getNumberFormat()) ? $style->getNumberFormat()->getFormatCode() : PHPExcel_Style_NumberFormat::FORMAT_GENERAL );