Sfoglia il codice sorgente

修复 A股下拉刷新时异常crash,修复市场检索异常crash

lintong 1 giorno fa
parent
commit
531d42804b

+ 4 - 0
Koala/Koala/Modular/JDTrade/VM/JDNewTradeAccountDetailViewModel.swift

@@ -443,6 +443,10 @@ extension JDNewTradeAccountDetailViewModel {
                 return
             }
             
+            guard marketDepthModel.asks.count > 0 && marketDepthModel.bids.count > 0 else {
+                return
+            }
+            
             model.ask = marketDepthModel.asks[0].price
             model.bid = marketDepthModel.bids[0].price
             BaseProductList.shareInstance.updateProductInfo(model: model)

+ 1 - 1
Koala/Koala/Modular/Market/VM/MarketSearchViewModel.swift

@@ -302,7 +302,7 @@ extension MarketSearchViewModel {
                     let increase = (conerData(np, .MyDouble).2!/conerData(model.close, .MyDouble).2!)*100
                     model.increase = String(format: "%.2f", increase)
                     
-                    for str in self!.collectionList {
+                    for str in self?.collectionList ?? [] {
                         if str == model.symbol {
                             model.isSelect = true
                         }