]> source.dussan.org Git - gitea.git/commitdiff
don't record error when loading ref comment but ref comment id is zero (#15820)
authorLunny Xiao <xiaolunwen@gmail.com>
Tue, 11 May 2021 20:43:35 +0000 (04:43 +0800)
committerGitHub <noreply@github.com>
Tue, 11 May 2021 20:43:35 +0000 (21:43 +0100)
models/issue_xref.go

index 8d3caba8c0b66b40513b5c64eda660fef4418cbc..fc8dd70f775f6bf4c607011ef144e75dcec4ca0a 100644 (file)
@@ -290,6 +290,9 @@ func CommentTypeIsRef(t CommentType) bool {
 
 // RefCommentHTMLURL returns the HTML URL for the comment that created this reference
 func (comment *Comment) RefCommentHTMLURL() string {
+       if comment.RefCommentID == 0 {
+               return ""
+       }
        if err := comment.LoadRefComment(); err != nil { // Silently dropping errors :unamused:
                log.Error("LoadRefComment(%d): %v", comment.RefCommentID, err)
                return ""