From f7ad198d7ec6def1a3c6355c1c8292e2b5a353ff Mon Sep 17 00:00:00 2001 From: Aleksandra Date: Thu, 30 Aug 2018 19:08:20 +0300 Subject: [PATCH] trying to property of non-object is repaired $tNode can be null, if the cell is empty. --- src/Spout/Reader/XLSX/Helper/CellValueFormatter.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Spout/Reader/XLSX/Helper/CellValueFormatter.php b/src/Spout/Reader/XLSX/Helper/CellValueFormatter.php index b4c6256..2cc770b 100644 --- a/src/Spout/Reader/XLSX/Helper/CellValueFormatter.php +++ b/src/Spout/Reader/XLSX/Helper/CellValueFormatter.php @@ -125,6 +125,11 @@ class CellValueFormatter // inline strings are formatted this way: // [INLINE_STRING] $tNode = $node->getElementsByTagName(self::XML_NODE_INLINE_STRING_VALUE)->item(0); + + if ($tNode === null) { + return null; + } + $cellValue = $this->escaper->unescape($tNode->nodeValue); return $cellValue; }