summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routers/api/v1/repo/repo.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index 116e413125..53ec0618ce 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -539,6 +539,10 @@ func updateBasicProperties(ctx *context.APIContext, opts api.EditRepoOption) err
if opts.Private != nil {
// Visibility of forked repository is forced sync with base repository.
if repo.IsFork {
+ if err := repo.GetBaseRepo(); err != nil {
+ ctx.Error(http.StatusInternalServerError, "Unable to load base repository", err)
+ return err
+ }
*opts.Private = repo.BaseRepo.IsPrivate
}