Fix panic when deleting image with no files (#5328)

This commit is contained in:
WithoutPants 2024-10-02 12:19:13 +10:00 committed by GitHub
parent 76a5b2a06a
commit c6c3754f02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {