diff --git a/pkg/download/downloader.go b/pkg/download/downloader.go index 7e466ced..adce3b01 100644 --- a/pkg/download/downloader.go +++ b/pkg/download/downloader.go @@ -302,9 +302,6 @@ func (d *Downloader) CreateDirect(req *base.Request, opts *base.Options) (taskId } func (d *Downloader) Create(rrId string, opts *base.Options) (taskId string, err error) { - if opts == nil { - opts = &base.Options{} - } d.fetcherMapLock.RLock() fetcher, ok := d.fetcherCache[rrId] d.fetcherMapLock.RUnlock() @@ -750,6 +747,9 @@ func (d *Downloader) doCreate(fetcher fetcher.Fetcher, opts *base.Options) (task if opts == nil { opts = &base.Options{} } + if opts.SelectFiles == nil { + opts.SelectFiles = make([]int, 0) + } meta := fetcher.Meta() meta.Opts = opts