Skip to content

Commit

Permalink
Fix null exceptions caused by invalid key for copy trading (#1447)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex1911-Jiang authored Dec 4, 2024
1 parent dfd1753 commit 849919d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ public async Task<WebCallResult<BinanceCopyTradingUserStatus>> GetUserStatusAsyn
var request = _definitions.GetOrCreate(HttpMethod.Get, "sapi/v1/copyTrading/futures/userStatus", BinanceExchange.RateLimiter.SpotRestUid, 20, true);
var data = await _baseClient.SendAsync<BinanceResult<BinanceCopyTradingUserStatus>>(request, parameters, ct).ConfigureAwait(false);

if (!data.Success)
return data.As<BinanceCopyTradingUserStatus>(default);

if (data.Data?.Code != 0)
return data.AsError<BinanceCopyTradingUserStatus>(new ServerError(data.Data!.Code, data.Data!.Message));

return data.As(data.Data.Data);
}

Expand Down

0 comments on commit 849919d

Please sign in to comment.