1
mirror of https://github.com/rclone/rclone synced 2024-11-17 17:30:37 +01:00

google cloud storage: Fix crash on Update error - fixes #9

This commit is contained in:
Nick Craig-Wood 2014-07-21 21:25:46 +01:00
parent 54cd46372a
commit 80ecea82e8

View File

@ -555,9 +555,12 @@ func (o *FsObjectStorage) Update(in io.Reader, modTime time.Time, size int64) er
Metadata: metadataFromModTime(modTime),
}
newObject, err := o.storage.svc.Objects.Insert(o.storage.bucket, &object).Media(in).Name(object.Name).PredefinedAcl(o.storage.objectAcl).Do()
if err != nil {
return err
}
// Set the metadata for the new object while we have it
o.setMetaData(newObject)
return err
return nil
}
// Remove an object