Skip to content

Commit

Permalink
fix:修复当sso未配置,查询数据时的问题 (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaxiaozz authored Jul 25, 2024
1 parent cb3f9dc commit a53e6bc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/service/v1/sso/sso.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,12 @@ func (s *service) List(options common.DBOptions) (*v1Sso.Sso, error) {
if err := db.All(&sso); err != nil {
return nil, err
}

if len(sso) == 0 {
return nil, errors.New("no such sso in db")
var ssoNoData v1Sso.Sso
return &ssoNoData, nil
}

return &sso[0], nil
}

Expand Down

0 comments on commit a53e6bc

Please sign in to comment.