From 8f211c4ee7f92ee4c5d1b2fb7665c0be0d5a1c76 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Fri, 9 Dec 2022 10:00:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=88=E4=B9=8B=E7=A7=98=E5=A2=83=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/moonfantasy/module.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/moonfantasy/module.go b/modules/moonfantasy/module.go index 84ba71e24..d8af92250 100644 --- a/modules/moonfantasy/module.go +++ b/modules/moonfantasy/module.go @@ -84,6 +84,11 @@ func (this *Moonfantasy) Trigger(session comm.IUserSession, source *pb.BattleRep triggerData *cfg.GameDreamlandTriggerData err error ) + if source == nil || source.Info == nil { + this.Error("Trigger", log.Fields{"err": "source is nil"}) + return + } + this.Debug("Trigger", log.Fields{"session": session.ToString(), "ptype": source.Info.Ptype}) if triggerData, err = this.configure.GettriggerData(int32(source.Info.Ptype)); err == nil && triggerData.Open { n, _ := rand.Int(rand.Reader, big.NewInt(1000)) if int32(n.Int64()) < triggerData.DreamlandPro {