diff --git a/backend/drive/drive.go b/backend/drive/drive.go index 5f1472ccf..625f4a303 100644 --- a/backend/drive/drive.go +++ b/backend/drive/drive.go @@ -1512,6 +1512,9 @@ func (f *Fs) newObjectWithExportInfo( // NewObject finds the Object at remote. If it can't be found // it returns the error fs.ErrorObjectNotFound. func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) { + if strings.HasSuffix(remote, "/") { + return nil, fs.ErrorIsDir + } info, extension, exportName, exportMimeType, isDocument, err := f.getRemoteInfoWithExport(ctx, remote) if err != nil { return nil, err