putio: fix panic on Object.Open #4315

This commit is contained in:
Cenk Alti 2020-06-08 23:13:41 +03:00 committed by Nick Craig-Wood
parent b2ded6212b
commit 16422a6b78

View file

@ -248,7 +248,10 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read
_ = resp.Body.Close() _ = resp.Body.Close()
return nil, fserrors.NoRetryError(err) return nil, fserrors.NoRetryError(err)
} }
return resp.Body, err if err != nil {
return nil, err
}
return resp.Body, nil
} }
// Update the already existing object // Update the already existing object