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), Metadata: metadataFromModTime(modTime),
} }
newObject, err := o.storage.svc.Objects.Insert(o.storage.bucket, &object).Media(in).Name(object.Name).PredefinedAcl(o.storage.objectAcl).Do() 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 // Set the metadata for the new object while we have it
o.setMetaData(newObject) o.setMetaData(newObject)
return err return nil
} }
// Remove an object // Remove an object