diff --git a/models/issue_xref.go b/models/issue_xref.go
index 8d3caba8c0..fc8dd70f77 100644
--- a/models/issue_xref.go
+++ b/models/issue_xref.go
@@ -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 ""