Ver código fonte

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>
Anusha Ragunathan 8 anos atrás
pai
commit
3c78938494
1 arquivos alterados com 5 adições e 1 exclusões
  1. 5 1
      volume/store/store.go

+ 5 - 1
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"