mirror of
https://github.com/miniflux/v2.git
synced 2025-08-21 18:11:09 +00:00
fix: store.GetEnclosure()
should return nil
if no rows are returned
This commit is contained in:
parent
810b351772
commit
eb4bca6eb7
5 changed files with 28 additions and 25 deletions
|
@ -90,7 +90,9 @@ func (s *Storage) GetEnclosure(enclosureID int64) (*model.Enclosure, error) {
|
|||
&enclosure.MediaProgression,
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
return nil, nil
|
||||
} else if err != nil {
|
||||
return nil, fmt.Errorf(`store: unable to fetch enclosure row: %v`, err)
|
||||
}
|
||||
|
||||
|
@ -164,8 +166,8 @@ func (s *Storage) UpdateEnclosure(enclosure *model.Enclosure) error {
|
|||
url=$1,
|
||||
size=$2,
|
||||
mime_type=$3,
|
||||
entry_id=$4,
|
||||
user_id=$5,
|
||||
entry_id=$4,
|
||||
user_id=$5,
|
||||
media_progression=$6
|
||||
WHERE
|
||||
id=$7
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue