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

Prevent NPE on commenting on lines with invalidated comments (#12549) #12550

Merged
merged 2 commits into from
Aug 21, 2020

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Aug 20, 2020

Backport (ish) of #12549 . This is a rebase of #12548 on 1.12 and represents a working fix for #12239 without the migration in #12549 that makes the template changes unnecessary.

#12239 reports an NPE when viewing the diff page of a PR when comments are made on a line that has previously had comments invalidated on it.

@mrsdizzie discovered the mechanism and reason this occurs.

This PR fixes the above NPE by setting a comment without Review to Comment Type.
It prevents a review being assigned to 0 by only checking for a review if we are replying to a previous review.
Finally it adds a section into the comments template to show these reviewless comments.
Fix #12239

Signed-off-by: Andrew Thornton [email protected]

Only check for a review if we are replying to a previous review.

Prevent the NPE in go-gitea#12239 by assuming that a comment without a Review is
non-pending.

Fix go-gitea#12239

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath zeripath changed the title Prevent NPE on commenting on lines with invalidated comments ( Prevent NPE on commenting on lines with invalidated comments (#12549) Aug 20, 2020
@zeripath zeripath added type/bug issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP labels Aug 20, 2020
@zeripath zeripath added this to the 1.12.4 milestone Aug 20, 2020
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Aug 20, 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 Aug 21, 2020
@lafriks lafriks merged commit 03ba12a into go-gitea:release/v1.12 Aug 21, 2020
@zeripath zeripath deleted the fix-12239-review-page-500 branch August 21, 2020 08:29
@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
issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP 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.

4 participants