mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-28 10:50:34 +00:00
do not return invalid result
This commit is contained in:
parent
6d814447d0
commit
5b8173f660
1 changed files with 2 additions and 2 deletions
|
@ -22,11 +22,11 @@ func FindFederatedReposByRepoID(ctx context.Context, repoId int64) ([]*Federated
|
||||||
federatedRepoList := make([]*FederatedRepo, 0, maxFederatedRepos)
|
federatedRepoList := make([]*FederatedRepo, 0, maxFederatedRepos)
|
||||||
err := sess.Find(&federatedRepoList)
|
err := sess.Find(&federatedRepoList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return federatedRepoList, err
|
return make([]*FederatedRepo, 0, maxFederatedRepos), err
|
||||||
}
|
}
|
||||||
for _, federatedRepo := range federatedRepoList {
|
for _, federatedRepo := range federatedRepoList {
|
||||||
if res, err := validation.IsValid(*federatedRepo); !res {
|
if res, err := validation.IsValid(*federatedRepo); !res {
|
||||||
return federatedRepoList, fmt.Errorf("FederationInfo is not valid: %v", err)
|
return make([]*FederatedRepo, 0, maxFederatedRepos), fmt.Errorf("FederationInfo is not valid: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return federatedRepoList, nil
|
return federatedRepoList, nil
|
||||||
|
|
Loading…
Reference in a new issue