mirror of
https://github.com/rclone/rclone.git
synced 2026-10-10 23:11:42 -04:00
iclouddrive: fix potential crash looking up items
findItem read the response status code when the lookup failed, so a failure with no HTTP response panicked. Thanks to @manus-pi for finding this problem.
This commit is contained in:
1 parent
35abcadfc7
commit
1e92520076
1 file changed
+1
-1
@@ -92,7 +92,7 @@ func (f *Fs) findItem(ctx context.Context, dir string) (item *api.DriveItem, fou
|
||||
item, resp, err = f.service.GetItemByPath(ctx, path.Join(f.root, dir))
|
||||
return shouldRetry(ctx, resp, err)
|
||||
}); err != nil {
|
||||
if item == nil && resp.StatusCode == 404 {
|
||||
if item == nil && resp != nil && resp.StatusCode == 404 {
|
||||
return nil, false, nil
|
||||
}
|
||||
return nil, false, err
|
||||
|
||||
Reference in new issue
Block a user