Skip to content

Commit 4047c5c

Browse files
authored
Ignore missing comment for user notifications (#18954) (#19043)
1 parent 03d9242 commit 4047c5c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

models/notification.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -498,14 +498,15 @@ func (n *Notification) APIURL() string {
498498
type NotificationList []*Notification
499499

500500
// LoadAttributes load Repo Issue User and Comment if not loaded
501-
func (nl NotificationList) LoadAttributes() (err error) {
501+
func (nl NotificationList) LoadAttributes() error {
502+
var err error
502503
for i := 0; i < len(nl); i++ {
503504
err = nl[i].LoadAttributes()
504505
if err != nil && !IsErrCommentNotExist(err) {
505-
return
506+
return err
506507
}
507508
}
508-
return
509+
return nil
509510
}
510511

511512
func (nl NotificationList) getPendingRepoIDs() []int64 {

routers/api/v1/notify/repo.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func ListRepoNotifications(ctx *context.APIContext) {
121121
return
122122
}
123123
err = nl.LoadAttributes()
124-
if err != nil && !models.IsErrCommentNotExist(err) {
124+
if err != nil {
125125
ctx.InternalServerError(err)
126126
return
127127
}

0 commit comments

Comments
 (0)