add null check [skip ci]

This commit is contained in:
Serhii 2022-12-06 17:14:07 +02:00
parent 35b7c05bc1
commit f29f17476c

View file

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