fix: nil pointer access in warmBackendAzure.Put (#13263)

This commit is contained in:
Krishnan Parthasarathi 2021-09-21 15:47:30 -07:00 committed by GitHub
parent 8392765213
commit 32df742b85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,7 +66,10 @@ func (az *warmBackendAzure) Put(ctx context.Context, object string, r io.Reader,
}
}
res, err := azblob.UploadStreamToBlockBlob(ctx, r, blobURL, azblob.UploadStreamToBlockBlobOptions{})
return remoteVersionID(res.Version()), azureToObjectError(err, az.Bucket, object)
if err != nil {
return "", azureToObjectError(err, az.Bucket, object)
}
return remoteVersionID(res.Version()), nil
}
func (az *warmBackendAzure) Get(ctx context.Context, object string, rv remoteVersionID, opts WarmBackendGetOpts) (r io.ReadCloser, err error) {