forked from TrueCloudLab/rclone
s3: fix nil pointer reference if no metadata returned for object
Fixes #3651 Fixes #3652
This commit is contained in:
parent
a3a5857874
commit
ab895390f4
1 changed files with 3 additions and 0 deletions
|
@ -1872,6 +1872,9 @@ func (o *Object) readMetaData(ctx context.Context) (err error) {
|
||||||
o.etag = aws.StringValue(resp.ETag)
|
o.etag = aws.StringValue(resp.ETag)
|
||||||
o.bytes = size
|
o.bytes = size
|
||||||
o.meta = resp.Metadata
|
o.meta = resp.Metadata
|
||||||
|
if o.meta == nil {
|
||||||
|
o.meta = map[string]*string{}
|
||||||
|
}
|
||||||
o.storageClass = aws.StringValue(resp.StorageClass)
|
o.storageClass = aws.StringValue(resp.StorageClass)
|
||||||
if resp.LastModified == nil {
|
if resp.LastModified == nil {
|
||||||
fs.Logf(o, "Failed to read last modified from HEAD: %v", err)
|
fs.Logf(o, "Failed to read last modified from HEAD: %v", err)
|
||||||
|
|
Loading…
Add table
Reference in a new issue