diff --git a/modules/arena/module.go b/modules/arena/module.go index d5961eb50..6348b3e40 100644 --- a/modules/arena/module.go +++ b/modules/arena/module.go @@ -100,6 +100,11 @@ func (this *Arena) Rpc_ModuleArenaRaceSettlement(ctx context.Context, args *pb.E // 修改用户积分 func (this *Arena) Rpc_ModuleArenaModifyIntegral(ctx context.Context, args *pb.RPCModifyIntegralReq, reply *pb.EmptyResp) (err error) { this.Debug("Rpc_ModuleArenaModifyIntegral", log.Field{Key: "args", Value: args.String()}) + //防止数据未初始化就修改数据 + if _, err = this.modelArena.queryPlayerInfo(args.Uid); err != nil && err != mgo.MongodbNil { + this.Debug("Rpc_ModuleArenaModifyIntegral", log.Field{Key: "err", Value: err.Error()}) + return + } err = this.modelArena.modifyIntegral(args.Uid, args.Integral) return }