Skip to content

Error 500 on edit a forked repo with api #14956

Closed
@Elbandi

Description

@Elbandi
  • Gitea version (or commit ref): 1.12.5+2-g1871afe63
  • Git version: 1:2.17.1-1ubuntu0.8
  • Operating system: Ubuntu bionic LTS
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes, pof code in my comment
    • No
  • Log gist:

2021/03/11 12:44:40 ...les/context/panic.go:35:1() [E] PANIC:: runtime error: invalid memory address or nil pointer dereference
/usr/lib/go-1.14/src/runtime/panic.go:212 (0x459619)
/usr/lib/go-1.14/src/runtime/signal_unix.go:695 (0x459468)
/gitea/routers/api/v1/repo/repo.go:539 (0x1a9987d)
/gitea/routers/api/v1/repo/repo.go:480 (0x1a9908f)
/usr/lib/go-1.14/src/reflect/value.go:460 (0x4a32ea)
/usr/lib/go-1.14/src/reflect/value.go:321 (0x4a27f3)
/gitea/vendor/gitea.com/macaron/inject/inject.go:177 (0xc356eb)
/gitea/vendor/gitea.com/macaron/inject/inject.go:137 (0xc350c9)
/gitea/vendor/gitea.com/macaron/macaron/context.go:121 (0xc50618)
/gitea/vendor/gitea.com/macaron/macaron/context.go:112 (0x126dba4)
/gitea/modules/context/repo.go:797 (0x126db8d)
/usr/lib/go-1.14/src/reflect/value.go:460 (0x4a32ea)
/usr/lib/go-1.14/src/reflect/value.go:321 (0x4a27f3)

Description

Editing a forked repo with gitea sdk, sample code

                orgRepos, _, err := gclient.ListOrgRepos("foo", gitea.ListOrgReposOptions{})
                repoOption := orgRepos[0]
		repository, _, err = gclient.EditRepo("foo", repoOption.Name, gitea.EditRepoOption{
			Name:                      &repoOption.Name,
			Description:               &repoOption.Description,
			Website:                   &repoOption.Website,
			Private:                   &repoOption.Private,
			HasIssues:                 &repoOption.HasIssues,
			HasWiki:                   &repoOption.HasWiki,
			DefaultBranch:             &repoOption.DefaultBranch,
			HasPullRequests:           &repoOption.HasPullRequests,
			IgnoreWhitespaceConflicts: &repoOption.IgnoreWhitespaceConflicts,
			AllowMerge:                &repoOption.AllowMerge,
			AllowRebase:               &repoOption.AllowRebase,
			AllowRebaseMerge:          &repoOption.AllowRebaseMerge,
			AllowSquash:               &repoOption.AllowSquash,
			//			Archived:                  &repoOption.Archived,
		})

Metadata

Metadata

Assignees

No one assigned

    Labels

    modifies/apiThis PR adds API routes or modifies themtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions