summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnusha Ragunathan <anusha.ragunathan@docker.com>2017-03-24 10:51:22 -0700
committerBrian Goff <cpuguy83@gmail.com>2017-05-16 16:16:32 -0400
commit3c7893849474dcd2cc19980b5752db80c094f94e (patch)
treec7fc8d21b13b8460e98de65bb2e6fbf530ecb862
parent54f75814d963bba21c32e294ce98505e164e32c2 (diff)
downloaddocker-3c7893849474dcd2cc19980b5752db80c094f94e.tar.gz
Add non-nil check before logging volume errors.
Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com> (cherry picked from commit b1570baadd76377aaeb7199c95ad6dc11b38f302) Signed-off-by: Brian Goff <cpuguy83@gmail.com>
-rw-r--r--volume/store/store.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/volume/store/store.go b/volume/store/store.go
index 0b8efc6c87..02c858a02d 100644
--- a/volume/store/store.go
+++ b/volume/store/store.go
@@ -519,7 +519,11 @@ func lookupVolume(driverName, volumeName string) (volume.Volume, error) {
if err != nil {
err = errors.Cause(err)
if _, ok := err.(net.Error); ok {
- return nil, errors.Wrapf(err, "error while checking if volume %q exists in driver %q", v.Name(), v.DriverName())
+ if v != nil {
+ volumeName = v.Name()
+ driverName = v.DriverName()
+ }
+ return nil, errors.Wrapf(err, "error while checking if volume %q exists in driver %q", volumeName, driverName)
}
// At this point, the error could be anything from the driver, such as "no such volume"