s3: fix nil pointer reference if no metadata returned for object

Fixes #3651 Fixes #3652
This commit is contained in:
Nick Craig-Wood 2019-10-23 08:16:22 +01:00
parent a3a5857874
commit ab895390f4

View File

@ -1872,6 +1872,9 @@ func (o *Object) readMetaData(ctx context.Context) (err error) {
o.etag = aws.StringValue(resp.ETag)
o.bytes = size
o.meta = resp.Metadata
if o.meta == nil {
o.meta = map[string]*string{}
}
o.storageClass = aws.StringValue(resp.StorageClass)
if resp.LastModified == nil {
fs.Logf(o, "Failed to read last modified from HEAD: %v", err)