-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Fix PR nil-dereference bug #2195
Conversation
Trusted LGTM |
models/issue.go
Outdated
if IsErrPullRequestNotExist(err) { | ||
return err | ||
} | ||
return fmt.Errorf("getPullRequestByIssueID: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why reformat error here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Causality of moving code around, I'll change it back to what it previously was (fmt.Errorf("getPullRequestByIssueID [%d]: %v", issue.ID, err)
)
if IsErrPullRequestNotExist(err) { | ||
return err | ||
} | ||
return fmt.Errorf("getPullRequestByIssueID [%d]: %v", issue.ID, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But still I think it should be loadPullRequest
in error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can change it if you really want, but this is more consistent with the other loadXYZ(..)
methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it is correct you are right
LGTM |
please force empty push |
Fixes #2190. Also adds unit tests for previously-broken methods.