Skip to content

Commit

Permalink
Fix sum with no results (#18685)
Browse files Browse the repository at this point in the history
  • Loading branch information
KnightVision90 authored and taylorotwell committed Apr 6, 2017
1 parent 7f2f892 commit 4c909d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,9 @@ public function max($column)
*/
public function sum($column)
{
return $this->aggregate(__FUNCTION__, [$column]);
$result = $this->aggregate(__FUNCTION__, [$column]);

return $result ?: 0;
}

/**
Expand Down

0 comments on commit 4c909d6

Please sign in to comment.