Skip to content

Commit 1a4e4ed

Browse files
brainfoolongPowerKiKi
authored andcommitted
fix php 8.1 error when autoFilter['ref'] is null
1 parent ef839f5 commit 1a4e4ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(Worksheet $workSheet, SimpleXMLElement $worksheetXml
2222
public function load(): void
2323
{
2424
// Remove all "$" in the auto filter range
25-
$autoFilterRange = preg_replace('/\$/', '', $this->worksheetXml->autoFilter['ref']);
25+
$autoFilterRange = preg_replace('/\$/', '', $this->worksheetXml->autoFilter['ref'] ?? '');
2626
if (strpos($autoFilterRange, ':') !== false) {
2727
$this->readAutoFilter($autoFilterRange, $this->worksheetXml);
2828
}

0 commit comments

Comments
 (0)