dropbox: fix nil pointer exception on restricted files
See: https://forum.rclone.org/t/issues-syncing-dropbox/12233
This commit is contained in:
parent
c892a6f8ef
commit
65a82fe77d
1 changed files with 3 additions and 5 deletions
|
@ -388,8 +388,7 @@ func (f *Fs) getMetadata(objPath string) (entry files.IsMetadata, notFound bool,
|
||||||
if err != nil {
|
if err != nil {
|
||||||
switch e := err.(type) {
|
switch e := err.(type) {
|
||||||
case files.GetMetadataAPIError:
|
case files.GetMetadataAPIError:
|
||||||
switch e.EndpointError.Path.Tag {
|
if e.EndpointError != nil && e.EndpointError.Path != nil && e.EndpointError.Path.Tag == files.LookupErrorNotFound {
|
||||||
case files.LookupErrorNotFound:
|
|
||||||
notFound = true
|
notFound = true
|
||||||
err = nil
|
err = nil
|
||||||
}
|
}
|
||||||
|
@ -489,8 +488,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e
|
||||||
if err != nil {
|
if err != nil {
|
||||||
switch e := err.(type) {
|
switch e := err.(type) {
|
||||||
case files.ListFolderAPIError:
|
case files.ListFolderAPIError:
|
||||||
switch e.EndpointError.Path.Tag {
|
if e.EndpointError != nil && e.EndpointError.Path != nil && e.EndpointError.Path.Tag == files.LookupErrorNotFound {
|
||||||
case files.LookupErrorNotFound:
|
|
||||||
err = fs.ErrorDirNotFound
|
err = fs.ErrorDirNotFound
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1012,7 +1010,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read
|
||||||
switch e := err.(type) {
|
switch e := err.(type) {
|
||||||
case files.DownloadAPIError:
|
case files.DownloadAPIError:
|
||||||
// Don't attempt to retry copyright violation errors
|
// Don't attempt to retry copyright violation errors
|
||||||
if e.EndpointError.Path.Tag == files.LookupErrorRestrictedContent {
|
if e.EndpointError != nil && e.EndpointError.Path != nil && e.EndpointError.Path.Tag == files.LookupErrorRestrictedContent {
|
||||||
return nil, fserrors.NoRetryError(err)
|
return nil, fserrors.NoRetryError(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue