Skip to content

Commit 5822d9d

Browse files
committed
handle nil total_bounty_amount
1 parent bc94b43 commit 5822d9d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/algora/bounties/schemas/prize_pool.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ defmodule Algora.Bounties.PrizePool do
7979
top_bounties = fetch_top_bounties(ticket_ids)
8080

8181
Enum.map(tickets, fn ticket ->
82-
Map.put(ticket, :top_bounties, Map.get(top_bounties, ticket.ticket_id, []))
82+
ticket
83+
|> Map.put(:top_bounties, Map.get(top_bounties, ticket.ticket_id, []))
84+
|> Map.put(:total_bounty_amount, ticket.total_bounty_amount || Money.zero(:USD))
8385
end)
8486
end
8587

0 commit comments

Comments
 (0)