fix null check

This commit is contained in:
Serhii 2022-12-06 11:41:25 +02:00
parent fa91ccfdbf
commit 35b7c05bc1

View file

@ -249,12 +249,14 @@ class SideShiftExchangeProvider extends ExchangeProvider {
final expectedSendAmount = responseJSON['depositAmount'].toString(); final expectedSendAmount = responseJSON['depositAmount'].toString();
final deposits = responseJSON['deposits'] as List?; final deposits = responseJSON['deposits'] as List?;
TradeState? state; TradeState? state;
if (deposits != null && deposits.isEmpty) { if (deposits != null) {
state = TradeState.deserialize(raw: 'created'); if (deposits.isEmpty) {
} else { state = TradeState.deserialize(raw: 'created');
final status = deposits?[0]['status'] as String; } else {
state = TradeState.deserialize(raw: status); final status = deposits[0]['status'] as String;
state = TradeState.deserialize(raw: status);
}
} }
final expiredAtRaw = responseJSON['expiresAtISO'] as String; final expiredAtRaw = responseJSON['expiresAtISO'] as String;