Skip to content

Commit

Permalink
worksheet: fix if cellValue does not exist (#1727)
Browse files Browse the repository at this point in the history
The condition is FALSE if the cell does not exist in the flipped table,
but anyway, it is sent in to a method requiring 'string' type, causing
it to fail.
  • Loading branch information
jasverix authored Dec 10, 2020
1 parent 1de03c2 commit 916b688
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ private function writeCellString(XMLWriter $objWriter, string $mappedType, $cell
{
$objWriter->writeAttribute('t', $mappedType);
if (!$cellValue instanceof RichText) {
self::writeElementIf($objWriter, isset($pFlippedStringTable[$cellValue]), 'v', $pFlippedStringTable[$cellValue]);
self::writeElementIf($objWriter, isset($pFlippedStringTable[$cellValue]), 'v', $pFlippedStringTable[$cellValue] ?? '');
} else {
$objWriter->writeElement('v', $pFlippedStringTable[$cellValue->getHashCode()]);
}
Expand Down

0 comments on commit 916b688

Please sign in to comment.