Skip to content

Commit

Permalink
Fix panic when deleting image with no files (#5328)
Browse files Browse the repository at this point in the history
  • Loading branch information
WithoutPants authored Oct 2, 2024
1 parent 76a5b2a commit c6c3754
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/sqlite/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,10 @@ func (qb *ImageStore) GetFiles(ctx context.Context, id int) ([]models.File, erro
return nil, err
}

return files, nil
ret := make([]models.File, len(files))
copy(ret, files)

return ret, nil
}

func (qb *ImageStore) GetManyFileIDs(ctx context.Context, ids []int) ([][]models.FileID, error) {
Expand Down

0 comments on commit c6c3754

Please sign in to comment.