fix null check
Serhii committed
Dec 6, 2022 at 11:41 UTC
35b7c05bc1650d41b25c3cc67385cd7b5a8caf95
1 file changed
+8
-6
lib/exchange/sideshift/sideshift_exchange_provider.dart
+8
-6
@@ -249,12 +249,14 @@ class SideShiftExchangeProvider extends ExchangeProvider {
249
final expectedSendAmount = responseJSON['depositAmount'].toString();
250
final deposits = responseJSON['deposits'] as List?;
251
TradeState? state;
252
-
253
- if (deposits != null && deposits.isEmpty) {
254
- state = TradeState.deserialize(raw: 'created');
255
- } else {
256
- final status = deposits?[0]['status'] as String;
257
- state = TradeState.deserialize(raw: status);
252
+
253
+ if (deposits != null) {
254
+ if (deposits.isEmpty) {
255
+ state = TradeState.deserialize(raw: 'created');
256
+ } else {
257
+ final status = deposits[0]['status'] as String;
258
+ state = TradeState.deserialize(raw: status);
259
+ }
260
}
261
262
final expiredAtRaw = responseJSON['expiresAtISO'] as String;