Skip to content

Commit

Permalink
Selection: fixed type error on empty aggregations [Closes #309]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 18, 2024
1 parent 2c71dc9 commit d8c6fd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Database/Table/Selection.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ public function aggregation(string $function, ?string $groupFunction = null): mi
return $this->explorer->query($query, ...$selection->getSqlBuilder()->getParameters())->fetch()->groupaggregate;
} else {
$selection->select($function);
foreach ($selection->fetch() as $val) {
foreach ($selection->fetch() ?? [] as $val) {
return $val;
}
return null;
Expand Down

0 comments on commit d8c6fd0

Please sign in to comment.