Skip to content

Commit 143071e

Browse files
authored
don't record error when loading ref comment but ref comment id is zero (#15820)
1 parent fc6501e commit 143071e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

models/issue_xref.go

+3
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ func CommentTypeIsRef(t CommentType) bool {
290290

291291
// RefCommentHTMLURL returns the HTML URL for the comment that created this reference
292292
func (comment *Comment) RefCommentHTMLURL() string {
293+
if comment.RefCommentID == 0 {
294+
return ""
295+
}
293296
if err := comment.LoadRefComment(); err != nil { // Silently dropping errors :unamused:
294297
log.Error("LoadRefComment(%d): %v", comment.RefCommentID, err)
295298
return ""

0 commit comments

Comments
 (0)