Skip to content

Commit

Permalink
fix php 8.1 error when autoFilter['ref'] is null
Browse files Browse the repository at this point in the history
  • Loading branch information
brainfoolong authored and PowerKiKi committed Feb 17, 2022
1 parent ef839f5 commit 1a4e4ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(Worksheet $workSheet, SimpleXMLElement $worksheetXml
public function load(): void
{
// Remove all "$" in the auto filter range
$autoFilterRange = preg_replace('/\$/', '', $this->worksheetXml->autoFilter['ref']);
$autoFilterRange = preg_replace('/\$/', '', $this->worksheetXml->autoFilter['ref'] ?? '');
if (strpos($autoFilterRange, ':') !== false) {
$this->readAutoFilter($autoFilterRange, $this->worksheetXml);
}
Expand Down

0 comments on commit 1a4e4ed

Please sign in to comment.