diff --git a/b2/b2.go b/b2/b2.go index 8a663a590..280a34958 100644 --- a/b2/b2.go +++ b/b2/b2.go @@ -1280,7 +1280,10 @@ func (o *Object) Update(in io.Reader, src fs.ObjectInfo) (err error) { if err != nil { return err } - defer o.fs.returnUploadURL(upload) + defer func() { + // return it like this because we might nil it out + o.fs.returnUploadURL(upload) + }() // Headers for upload file //