mirror of
https://github.com/rclone/rclone.git
synced 2025-06-23 21:41:36 +02:00
iclouddrive: fix panic and files potentially downloaded twice
- Fixing SIGSEGV Fixes #8211 - Removed files potentially downloaded twice
This commit is contained in:
parent
fe880c0fac
commit
9d55b2411f
@ -252,18 +252,14 @@ func (d *DriveService) DownloadFile(ctx context.Context, url string, opt []fs.Op
|
|||||||
}
|
}
|
||||||
|
|
||||||
resp, err := d.icloud.srv.Call(ctx, opts)
|
resp, err := d.icloud.srv.Call(ctx, opts)
|
||||||
if err != nil {
|
|
||||||
// icloud has some weird http codes
|
// icloud has some weird http codes
|
||||||
if resp.StatusCode == 330 {
|
if err != nil && resp != nil && resp.StatusCode == 330 {
|
||||||
loc, err := resp.Location()
|
loc, err := resp.Location()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return d.DownloadFile(ctx, loc.String(), opt)
|
return d.DownloadFile(ctx, loc.String(), opt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
|
||||||
return d.icloud.srv.Call(ctx, opts)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MoveItemToTrashByItemID moves an item to the trash based on the item ID.
|
// MoveItemToTrashByItemID moves an item to the trash based on the item ID.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user