Merge pull request #27678 from GreenHedgehog/master

Fix possible nil pointer dereference in azure sdk
This commit is contained in:
James Bardin 2021-02-17 08:49:49 -05:00 committed by GitHub
commit b0094dbf36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"log"
"net/http"
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/go-uuid"
@ -39,7 +40,7 @@ func (c *RemoteClient) Get() (*remote.Payload, error) {
ctx := context.TODO()
blob, err := c.giovanniBlobClient.Get(ctx, c.accountName, c.containerName, c.keyName, options)
if err != nil {
if blob.Response.StatusCode == 404 {
if blob.Response.IsHTTPStatus(http.StatusNotFound) {
return nil, nil
}
return nil, err