jimmyyem 1 dia atrás
pai
commit
2f7b21ac12
1 arquivos alterados com 4 adições e 0 exclusões
  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)