Skip to content

Commit 140e4d7

Browse files
authored
Fixing issue where Fees = null so null += Anything == null (#812)
1 parent ddfac39 commit 140e4d7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,7 @@ private static void ParseFees(JToken feesToken, ExchangeOrderResult result)
661661
bool currencySet = false;
662662
foreach (var trade in tradesInOrder)
663663
{
664+
result.Fees ??= 0;
664665
result.Fees += trade["commission"].ConvertInvariant<decimal>();
665666

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

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

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

0 commit comments

Comments
 (0)