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

Ensure issue.Poster is loaded in mailIssueCommentToParticipants #5891

Merged
merged 1 commit into from Jan 29, 2019

Conversation

5 participants
@zeripath
Copy link
Contributor

zeripath commented Jan 29, 2019

Previous code could potentially dereference nil - this PR ensures
that the poster is loaded before dereferencing it.

Fixes issue reported on Discord by drewG

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

@techknowlogick techknowlogick added this to the 1.8.0 milestone Jan 29, 2019

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jan 29, 2019

Codecov Report

Merging #5891 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5891   +/-   ##
=======================================
  Coverage   38.01%   38.01%           
=======================================
  Files         328      328           
  Lines       48328    48328           
=======================================
  Hits        18370    18370           
  Misses      27319    27319           
  Partials     2639     2639
Impacted Files Coverage Δ
models/issue_mail.go 12% <0%> (ø) ⬆️

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 8917d66...ac6b7e7. Read the comment docs.

Show resolved Hide resolved models/issue_mail.go Outdated
Ensure issue.Poster is loaded in mailIssueCommentToParticipants
Previous code could potentially dereference nil - this PR ensures
that the poster is loaded before dereferencing it.

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

@zeripath zeripath force-pushed the zeripath:check-poster-is-set-in-mail-comments branch from ac6b7e7 to be41436 Jan 29, 2019

@zeripath

This comment has been minimized.

Copy link
Contributor Author

zeripath commented Jan 29, 2019

@adelowo is my change ok? (I really think we need to get this approved quickly and before we release v1.7.1 as every person who is on 1.7 and has ENABLE_NOTIFY_MAIL set to true will be experiencing server 500s.)

@GiteaBot GiteaBot added lgtm/need 1 and removed lgtm/need 2 labels Jan 29, 2019

@zeripath zeripath referenced this pull request Jan 29, 2019

Closed

Error 500 on comment creation via API, with sudo #5871

2 of 7 tasks complete

@GiteaBot GiteaBot added lgtm/done and removed lgtm/need 1 labels Jan 29, 2019

@techknowlogick techknowlogick merged commit 036964b into go-gitea:master Jan 29, 2019

2 checks passed

approvals/lgtm this commit looks good
continuous-integration/drone/pr the build was successful
Details

zeripath added a commit to zeripath/gitea that referenced this pull request Jan 29, 2019

Ensure issue.Poster is loaded in mailIssueCommentToParticipants (go-g…
…itea#5891)

Previous code could potentially dereference nil - this PR ensures
that the poster is loaded before dereferencing it.

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

This comment has been minimized.

Copy link
Contributor Author

zeripath commented Jan 29, 2019

Of course I then rebase and run my magical #5893 on it and notice another dereference bug...

The repo needs to be loaded too in v1.7 that is. I'll put the fix in to the backport and open another one on master - which is I think protected by these things being loaded higher up but we should ensure that they're there at this level I think.

zeripath added a commit that referenced this pull request Jan 29, 2019

Prevent nil dereference in mailIssueCommentToParticipants (#5891, #5895
…) (#5894)

* Ensure issue.Poster is loaded in mailIssueCommentToParticipants (#5891)

Previous code could potentially dereference nil - this PR ensures
that the poster is loaded before dereferencing it.

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

* Also ensure the repo is loaded

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

@zeripath zeripath deleted the zeripath:check-poster-is-set-in-mail-comments branch Jan 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment