From 71ef2821f27096edf9fbde830fd94200daaad15e Mon Sep 17 00:00:00 2001 From: zhaocy Date: Tue, 28 Jun 2022 14:01:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8B=B1=E9=9B=84=E5=88=97=E8=A1=A8=E7=A9=BA?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/model_hero.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index aa6e654d9..37b0ca266 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -5,6 +5,7 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/lego/core" "go_dreamfactory/lego/sys/log" + "go_dreamfactory/lego/sys/redis" "go_dreamfactory/modules" "go_dreamfactory/pb" "math" @@ -96,6 +97,9 @@ func (this *ModelHero) getHeroList(uid string) ([]*pb.DB_HeroData, error) { herokeys := make(map[string]string) err := this.Get(uid, herokeys) if err != nil { + if err == redis.RedisNil { + return make([]*pb.DB_HeroData, 0), nil + } return nil, err }