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

fs: fix panic when using --metadata-mapper on large google doc files

Nick Craig-Wood488ed2863544
diff --git a/fs/object/object.go b/fs/object/object.go
index 93c923681..01b38f57a 100644
--- a/fs/object/object.go
+++ b/fs/object/object.go
@@ -43,6 +43,9 @@ func NewStaticObjectInfo(remote string, modTime time.Time, size int64, storable
info.hashes[ht] = ""
}
}
+ if f == nil {
+ info.fs = MemoryFs
+ }
return info
}
diff --git a/fs/object/object_test.go b/fs/object/object_test.go
index 1e5ca75c4..64bb36140 100644
--- a/fs/object/object_test.go
+++ b/fs/object/object_test.go
@@ -34,6 +34,7 @@ func TestStaticObject(t *testing.T) {
o = object.NewStaticObjectInfo(remote, now, size, true, nil, nil)
_, err = o.Hash(context.Background(), hash.MD5)
assert.Equal(t, hash.ErrUnsupported, err)
+ assert.Equal(t, object.MemoryFs, o.Fs())
hs := map[hash.Type]string{
hash.MD5: "potato",