Skip to content

Commit abaa102

Browse files
author
MarkBaker
committed
Resolve issue with boolean in branch pruning when array is expected
1 parent 1998862 commit abaa102

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PhpSpreadsheet/Calculation/Calculation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4413,7 +4413,7 @@ private function processTokenStack($tokens, $cellID = null, ?Cell $cell = null)
44134413
true : (bool) Functions::flattenSingleValue($storeValue);
44144414
if (is_array($storeValue)) {
44154415
$wrappedItem = end($storeValue);
4416-
$storeValue = end($wrappedItem);
4416+
$storeValue = is_array($wrappedItem) ? end($wrappedItem) : $wrappedItem;
44174417
}
44184418

44194419
if (
@@ -4445,7 +4445,7 @@ private function processTokenStack($tokens, $cellID = null, ?Cell $cell = null)
44454445
true : (bool) Functions::flattenSingleValue($storeValue);
44464446
if (is_array($storeValue)) {
44474447
$wrappedItem = end($storeValue);
4448-
$storeValue = end($wrappedItem);
4448+
$storeValue = is_array($wrappedItem) ? end($wrappedItem) : $wrappedItem;
44494449
}
44504450

44514451
if (

0 commit comments

Comments
 (0)