don't record error when loading ref comment but ref comment id is zero (#15820)

This commit is contained in:
Lunny Xiao 2021-05-12 04:43:35 +08:00 коммит произвёл GitHub
Родитель fc6501e4e0
Коммит 143071ee41
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -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 ""