mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
* use e if it is an option * potential nil so check err first * check err first * m == nil already checked
This commit is contained in:
@@ -749,8 +749,12 @@ func CreateRefComment(doer *User, repo *Repository, issue *Issue, content, commi
|
||||
|
||||
// GetCommentByID returns the comment by given ID.
|
||||
func GetCommentByID(id int64) (*Comment, error) {
|
||||
return getCommentByID(x, id)
|
||||
}
|
||||
|
||||
func getCommentByID(e Engine, id int64) (*Comment, error) {
|
||||
c := new(Comment)
|
||||
has, err := x.ID(id).Get(c)
|
||||
has, err := e.ID(id).Get(c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if !has {
|
||||
|
Reference in New Issue
Block a user