mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
fix: add rows.Err() check in GetAttachmentsByMessageIDs
Prevents silently returning truncated attachment maps when the DB cursor errors mid-iteration. Matches the pattern used in all other query loops across the codebase.
This commit is contained in:
@@ -110,5 +110,8 @@ func (d *DB) GetAttachmentsByMessageIDs(msgIDs []int64) (map[int64][]AttachmentI
|
||||
ai.URL = "/api/v1/files/" + id
|
||||
result[msgID] = append(result[msgID], ai)
|
||||
}
|
||||
if rows.Err() != nil {
|
||||
return nil, fmt.Errorf("GetAttachmentsByMessageIDs rows: %w", rows.Err())
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user