← All changes
|
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig.php
+3
-2
3.1.3
→
3.7.4
View file →
| @@ -1223,13 +1223,14 @@ | ||
| 1223 | 1223 | $arg = Calculation::wrapResult(strtoupper($arg)); |
| 1224 | 1224 | } |
| 1225 | 1225 | |
| 1226 | 1226 | $testCondition = '=' . $arg . $condition; |
| 1227 | + $sumValue = array_key_exists($key, $sumArgs) ? $sumArgs[$key] : 0; | |
| 1227 | 1228 | |
| 1228 | - if (is_numeric($sumArgs[$key]) && | |
| 1229 | + if (is_numeric($sumValue) && | |
| 1229 | 1230 | Calculation::getInstance()->_calculateFormulaValue($testCondition)) { |
| 1230 | 1231 | // Is it a value within our criteria and only numeric can be added to the result |
| 1231 | - $returnValue += $sumArgs[$key]; | |
| 1232 | + $returnValue += $sumValue; | |
| 1232 | 1233 | } |
| 1233 | 1234 | } |
| 1234 | 1235 | |
| 1235 | 1236 | return $returnValue; |