google cloud storage: Fix crash on Update error - fixes #9
This commit is contained in:
parent
54cd46372a
commit
80ecea82e8
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue