diff --git a/controllers/tictok_callback.go b/controllers/tictok_callback.go index c0e1361a5..8e20a52d3 100644 --- a/controllers/tictok_callback.go +++ b/controllers/tictok_callback.go @@ -43,14 +43,14 @@ func (c *TicTocController) TiktokMsg() { if c.Ctx.Input.Method() == http.MethodPost { call, refund, payType, err := api.TiktokApi.GetCallbackMsg(getPayInfo(c.Ctx)) globals.SugarLogger.Debugf("tictok callback callbackResponse:%s", utils.Format4Output(call, true)) - if err != nil { + if err != nil || call == nil{ c.Data["json"] = MsgFail() c.ServeJSON() globals.SugarLogger.Debugf("============err:%s", err) return } - err = localjx.OnTTPayCallback(call, refund, payType) - if err != nil { + + if err = localjx.OnTTPayCallback(call, refund, payType); err != nil { c.Data["json"] = MsgFail() c.ServeJSON() globals.SugarLogger.Debugf("============err:%s", err)