Merge pull request #27678 from GreenHedgehog/master
Fix possible nil pointer dereference in azure sdk
This commit is contained in:
commit
b0094dbf36
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue