Skip to content

Commit f4885d9

Browse files
committed
PHP 8.1 compatibility
1 parent 0371ccb commit f4885d9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ function ($index) use ($cellReference) {
3939
if ($cellReference->getWorksheet()->cellExists($column . $row)) {
4040
//take this cell out if it contains the SUBTOTAL or AGGREGATE functions in a formula
4141
$isFormula = $cellReference->getWorksheet()->getCell($column . $row)->isFormula();
42-
$cellFormula = !preg_match('/^=.*\b(SUBTOTAL|AGGREGATE)\s*\(/i', $cellReference->getWorksheet()->getCell($column . $row)->getValue());
42+
$cellFormula = !preg_match(
43+
'/^=.*\b(SUBTOTAL|AGGREGATE)\s*\(/i',
44+
$cellReference->getWorksheet()->getCell($column . $row)->getValue() ?? ''
45+
);
4346

4447
$retVal = !$isFormula || $cellFormula;
4548
}

0 commit comments

Comments
 (0)