mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-21 08:31:27 -05:00
prevent error when setting no fed repos
This commit is contained in:
parent
9212fb1633
commit
8b56159042
1 changed files with 6 additions and 1 deletions
|
@ -205,7 +205,12 @@ func SettingsPost(ctx *context.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, _, err := federation.StoreFederatedRepoList(ctx, ctx.Repo.Repository.ID, strings.Split(federationRepos, ";")); err != nil {
|
federationRepoSplit := strings.Split(federationRepos, ";")
|
||||||
|
if strings.TrimSpace(federationRepos) == "" {
|
||||||
|
federationRepoSplit = []string{}
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, _, err := federation.StoreFederatedRepoList(ctx, ctx.Repo.Repository.ID, federationRepoSplit); err != nil {
|
||||||
ctx.ServerError("UpdateRepository", err)
|
ctx.ServerError("UpdateRepository", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue