From ccf291234e2cd561d3be24cf7860eaca312fe039 Mon Sep 17 00:00:00 2001 From: troosan Date: Fri, 28 Dec 2018 20:32:10 +0100 Subject: [PATCH] Avoid warning if variable is null --- src/PhpWord/Writer/ODText/Style/Table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpWord/Writer/ODText/Style/Table.php b/src/PhpWord/Writer/ODText/Style/Table.php index 5ddee25a..c64dee4f 100644 --- a/src/PhpWord/Writer/ODText/Style/Table.php +++ b/src/PhpWord/Writer/ODText/Style/Table.php @@ -47,7 +47,7 @@ class Table extends AbstractStyle $xmlWriter->endElement(); // style:style $cellWidths = $style->getColumnWidths(); - $countCellWidths = count($cellWidths); + $countCellWidths = $cellWidths === null ? 0 : count($cellWidths); for ($i = 0; $i < $countCellWidths; $i++) { $width = $cellWidths[$i];