Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

drive: fix crash when trying to creating shortcut to a Google doc

Nick Craig-Wood40f2e847a338
diff --git a/backend/drive/drive.go b/backend/drive/drive.go
index 2c7a3aa63..712286014 100644
--- a/backend/drive/drive.go
+++ b/backend/drive/drive.go
@@ -3409,9 +3409,11 @@ func (f *Fs) makeShortcut(ctx context.Context, srcPath string, dstFs *Fs, dstPat
return nil, fmt.Errorf("failed to find source dir: %w", err)
}
isDir = true
- } else {
+ } else if do, ok := srcObj.(fs.IDer); ok {
// source was a file
- srcID = srcObj.(*Object).id
+ srcID = do.ID()
+ } else {
+ return nil, fmt.Errorf("unknown source object: %T", srcObj)
}
srcID = actualID(srcID) // link to underlying object not to shortcut