Skip to content

Commit

Permalink
Fixing issue where Fees = null so null += Anything == null (#812)
Browse files Browse the repository at this point in the history
  • Loading branch information
O-Mutt authored Aug 30, 2023
1 parent ddfac39 commit 140e4d7
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ private static void ParseFees(JToken feesToken, ExchangeOrderResult result)
bool currencySet = false;
foreach (var trade in tradesInOrder)
{
result.Fees ??= 0;
result.Fees += trade["commission"].ConvertInvariant<decimal>();

// TODO: Not sure how to handle commissions in different currencies, for example if you run out of BNB mid-trade
Expand Down Expand Up @@ -1016,6 +1017,7 @@ private static void ParseAveragePriceAndFeesFromFills(ExchangeOrderResult result
currencySet = true;
}

result.Fees ??= 0;
result.Fees += fill["commission"].ConvertInvariant<decimal>();

decimal price = fill["price"].ConvertInvariant<decimal>();
Expand Down

0 comments on commit 140e4d7

Please sign in to comment.