From 372f2916022536f4170050ff2ad81cf97c1adfd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 6 Jun 2022 13:56:04 +0800 Subject: [PATCH] 1 --- controllers/tictok_callback.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)