fix object storage nil pointer deref error
diff --git a/rackspace/objectstorage/v1/bulk/requests.go b/rackspace/objectstorage/v1/bulk/requests.go
index 898b73b..0aeec15 100644
--- a/rackspace/objectstorage/v1/bulk/requests.go
+++ b/rackspace/objectstorage/v1/bulk/requests.go
@@ -43,7 +43,9 @@
JSONBody: reqBody,
JSONResponse: &res.Body,
})
- res.Header = resp.Header
+ if resp != nil {
+ res.Header = resp.Header
+ }
res.Err = err
return res
}
diff --git a/rackspace/objectstorage/v1/cdncontainers/requests.go b/rackspace/objectstorage/v1/cdncontainers/requests.go
index 8e4abbe..6acebb0 100644
--- a/rackspace/objectstorage/v1/cdncontainers/requests.go
+++ b/rackspace/objectstorage/v1/cdncontainers/requests.go
@@ -53,7 +53,9 @@
MoreHeaders: h,
OkCodes: []int{201, 202, 204},
})
- res.Header = resp.Header
+ if resp != nil {
+ res.Header = resp.Header
+ }
res.Err = err
return res
}
@@ -66,7 +68,9 @@
resp, err := c.Request("HEAD", getURL(c, containerName), gophercloud.RequestOpts{
OkCodes: []int{200, 204},
})
- res.Header = resp.Header
+ if resp != nil {
+ res.Header = resp.Header
+ }
res.Err = err
return res
}
@@ -149,7 +153,9 @@
MoreHeaders: h,
OkCodes: []int{202, 204},
})
- res.Header = resp.Header
+ if resp != nil {
+ res.Header = resp.Header
+ }
res.Err = err
return res
}