Browse Source

fix sendTo nil error

animeic 1 year ago
parent
commit
612ac78527
2 changed files with 7 additions and 2 deletions
  1. 4 1
      boxcost/api/plan.go
  2. 3 1
      boxcost/api/summary.go

+ 4 - 1
boxcost/api/plan.go

@@ -1088,7 +1088,10 @@ func GetProductPlan(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 						if ok {
 							billStates[stage.BillId] = state["status"].(string)
 							billSerialNumber[stage.BillId] = state["serialNumber"].(string)
-							billSendTo[stage.BillId] = state["sendTo"].(string)
+							if v, ok := state["sendTo"]; ok {
+								billSendTo[stage.BillId] = v.(string)
+							}
+
 							if v, ok := state["isSend"]; ok {
 								billIsSend[stage.BillId] = v.(bool)
 

+ 3 - 1
boxcost/api/summary.go

@@ -195,7 +195,9 @@ func GetPlanStatus(plan *model.ProductPlan, apictx *ApiSession) *PlanSummary {
 						if ok {
 							billStates[stage.BillId] = state["status"].(string)
 							billSerialNumber[stage.BillId] = state["serialNumber"].(string)
-							billSendTo[stage.BillId] = state["sendTo"].(string)
+							if v, ok := state["sendTo"]; ok {
+								billSendTo[stage.BillId] = v.(string)
+							}
 							if v, ok := state["isSend"]; ok {
 								billIsSend[stage.BillId] = v.(bool)