Skip to content

Prevent panic when editing forked repos by API#14960

Merged
6543 merged 2 commits into
go-gitea:masterfrom
zeripath:fix-14956-load-baserepo-in-forks
Mar 11, 2021
Merged

Prevent panic when editing forked repos by API#14960
6543 merged 2 commits into
go-gitea:masterfrom
zeripath:fix-14956-load-baserepo-in-forks

Conversation

@zeripath
Copy link
Copy Markdown
Contributor

When editing forked repos using the API the BaseRepository needs to loaded
in order to check its visibility otherwise there will be NPE panic.

Fix #14956

Signed-off-by: Andrew Thornton art27@cantab.net

When editing forked repos using the API the BaseRepository needs to loaded
in order to check its visibility otherwise there will be NPE panic.

Fix go-gitea#14956

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added this to the 1.14.0 milestone Mar 11, 2021
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Mar 11, 2021
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 11, 2021
@6543 6543 merged commit 5705f72 into go-gitea:master Mar 11, 2021
6543 pushed a commit to 6543-forks/gitea that referenced this pull request Mar 11, 2021
When editing forked repos using the API the BaseRepository needs to loaded
in order to check its visibility otherwise there will be NPE panic.

Fix go-gitea#14956

Signed-off-by: Andrew Thornton <art27@cantab.net>
@6543
Copy link
Copy Markdown
Member

6543 commented Mar 11, 2021

Backport: #14963

@6543 6543 added the backport/done All backports for this PR have been created label Mar 11, 2021
@zeripath zeripath deleted the fix-14956-load-baserepo-in-forks branch March 11, 2021 18:13
lunny pushed a commit that referenced this pull request Mar 12, 2021
When editing forked repos using the API the BaseRepository needs to loaded
in order to check its visibility otherwise there will be NPE panic.

Fix #14956

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: zeripath <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error 500 on edit a forked repo with api

5 participants