jimmyyem hace 1 día
padre
commit
2f7b21ac12
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      hook/credit/models.go

+ 4 - 0
hook/credit/models.go

@@ -90,6 +90,10 @@ func Subtraction(number1, number2 float64) float64 {
 func ComputeModelPrice(response interface{}) (model string, price float64) {
 	fmt.Printf("response=%v  \n", response)
 
+	if response == nil {
+		return modelArray[0], priceArray[0]
+	}
+
 	// 先获取所有本次响应里所有的model
 	modelInputArray := make([]string, 0)