Skip to content

Fix nil object access in some conditions when parsing cross references #8281

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

Merged
merged 10 commits into from
Sep 25, 2019
Prev Previous commit
Fix nil ref
  • Loading branch information
guillep2k committed Sep 25, 2019
commit 5612c6b55a86d3f25b97bd2888dccaf16c4b9ac0
2 changes: 1 addition & 1 deletion models/issue_xref.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (issue *Issue) isValidCommentReference(e Engine, ctx *crossReferencesContex
return nil, err
}
// Check user permissions
if refIssue.Repo.ID != ctx.OrigIssue.Repo.ID {
if refIssue.RepoID != ctx.OrigIssue.RepoID {
perm, err := getUserRepoPermission(e, refIssue.Repo, ctx.Doer)
if err != nil {
return nil, err
Expand Down