diff --git a/modules/pagoda/api_challenge.go b/modules/pagoda/api_challenge.go index e684845c4..abba8ed13 100644 --- a/modules/pagoda/api_challenge.go +++ b/modules/pagoda/api_challenge.go @@ -28,7 +28,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng } conf, err := this.module.configure.GetPagodaConfigData(req.Cid) - if conf != nil { + if err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_PagodaNotFound, Title: pb.ErrorCode_PagodaNotFound.ToString(), diff --git a/modules/pagoda/api_challengeover.go b/modules/pagoda/api_challengeover.go index 59d4b270a..94d7fe6b5 100644 --- a/modules/pagoda/api_challengeover.go +++ b/modules/pagoda/api_challengeover.go @@ -37,7 +37,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal } conf, err := this.module.configure.GetPagodaConfigData(req.Cid) - if conf != nil { + if err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_PagodaNotFound, Title: pb.ErrorCode_PagodaNotFound.ToString(),