diff --git a/lib/HtmlPhpExcel/HtmlPhpExcel.php b/lib/HtmlPhpExcel/HtmlPhpExcel.php
index b81a212..aa36a4f 100644
--- a/lib/HtmlPhpExcel/HtmlPhpExcel.php
+++ b/lib/HtmlPhpExcel/HtmlPhpExcel.php
@@ -148,10 +148,12 @@ private function createExcel(): void
$rowIndex = 1;
foreach($table->getRows() as $row) {
$rowStyles = $this->getStyles($row);
- $sheet->setRowStyles(
- $rowIndex,
- empty($rowStyles) ? null : $rowStyles
- );
+ if (!empty($rowStyles)) {
+ $sheet->setRowStyles(
+ $rowIndex,
+ $rowStyles
+ );
+ }
// Loop over all cells in a row
$colIndex = 1;