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 deposits = responseJSON['deposits'] as List?;
TradeState? state;
if (deposits != null && deposits.isEmpty) {
state = TradeState.deserialize(raw: 'created');
} else {
final status = deposits?[0]['status'] as String;
state = TradeState.deserialize(raw: status);
if (deposits != null) {
if (deposits.isEmpty) {
state = TradeState.deserialize(raw: 'created');
} else {
final status = deposits[0]['status'] as String;
state = TradeState.deserialize(raw: status);
}
}
final expiredAtRaw = responseJSON['expiresAtISO'] as String;