Add non-nil check before logging volume errors.
Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
This commit is contained in:
parent
d8406fd7a0
commit
b1570baadd
|
@ -542,7 +542,11 @@ func lookupVolume(driverName, volumeName string) (volume.Volume, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = errors.Cause(err)
|
err = errors.Cause(err)
|
||||||
if _, ok := err.(net.Error); ok {
|
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"
|
// At this point, the error could be anything from the driver, such as "no such volume"
|
||||||
|
|
Loading…
Reference in New Issue