From 32df742b856a4ec99d0159ffadb751f7586a2e2b Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Tue, 21 Sep 2021 15:47:30 -0700 Subject: [PATCH] fix: nil pointer access in warmBackendAzure.Put (#13263) --- cmd/warm-backend-azure.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/warm-backend-azure.go b/cmd/warm-backend-azure.go index 01ec4033f..e426e95db 100644 --- a/cmd/warm-backend-azure.go +++ b/cmd/warm-backend-azure.go @@ -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) {