zwxi 1 vuosi sitten
vanhempi
commit
23ac2693e8
1 muutettua tiedostoa jossa 6 lisäystä ja 2 poistoa
  1. 6 2
      services/base_from_ths_ds.go

+ 6 - 2
services/base_from_ths_ds.go

@@ -151,7 +151,9 @@ func getEdbDataFromThsDsApp(stockCode, edbCode, startDate, endDate string, num i
 
 				for k, v := range stockData {
 					if k != "time" && k != "thscode" {
-						tableValueList = append(tableValueList, v.(float64))
+						if v != nil {
+							tableValueList = append(tableValueList, v.(float64))
+						}
 					}
 				}
 			}
@@ -197,7 +199,9 @@ func getEdbDataFromThsDsApp(stockCode, edbCode, startDate, endDate string, num i
 
 			for k, v := range stockData {
 				if k != "time" && k != "thscode" {
-					tableValueList = append(tableValueList, v.(float64))
+					if v != nil {
+						tableValueList = append(tableValueList, v.(float64))
+					}
 				}
 			}
 		}