Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always return a list from GetCommitsFromIDs #12981

Merged

Conversation

zeripath
Copy link
Contributor

GetCommitsFromIDs is only used in one place: LoadPushCommits where
it expects that c.Commits is not nil.

This potentially nil set causes a NPE in in #12953

Fix #12953

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

`GetCommitsFromIDs` is only used in one place: `LoadPushCommits` where
it expects that `c.Commits` is not nil.

This potentially nil set causes a NPE in in go-gitea#12953

Fix go-gitea#12953

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added this to the 1.13.0 milestone Sep 29, 2020
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Sep 29, 2020
@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 Sep 29, 2020
@codecov-commenter
Copy link

codecov-commenter commented Sep 29, 2020

Codecov Report

Merging #12981 into master will increase coverage by 0.12%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12981      +/-   ##
==========================================
+ Coverage   42.47%   42.59%   +0.12%     
==========================================
  Files         671      671              
  Lines       73627    73625       -2     
==========================================
+ Hits        31272    31362      +90     
+ Misses      37291    37188     -103     
- Partials     5064     5075      +11     
Impacted Files Coverage Δ
modules/git/repo_commit.go 50.91% <ø> (+0.37%) ⬆️
models/repo_mirror.go 2.38% <0.00%> (-11.91%) ⬇️
modules/charset/charset.go 68.53% <0.00%> (-4.50%) ⬇️
modules/cron/tasks_basic.go 87.35% <0.00%> (-3.45%) ⬇️
modules/log/event.go 56.60% <0.00%> (-2.84%) ⬇️
services/mirror/mirror.go 18.51% <0.00%> (-1.35%) ⬇️
services/pull/pull.go 40.78% <0.00%> (+0.49%) ⬆️
models/error.go 35.19% <0.00%> (+0.84%) ⬆️
models/notification.go 66.66% <0.00%> (+0.90%) ⬆️
modules/process/manager.go 75.00% <0.00%> (+2.50%) ⬆️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1bcf1ad...91bc4c8. Read the comment docs.

@zeripath zeripath merged commit fe79b13 into go-gitea:master Sep 29, 2020
@zeripath zeripath deleted the fix-12953-prevent-NPE-in-issue_comments branch September 29, 2020 21:26
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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.

Pull request 500 error after force push
5 participants