Add non-nil check before logging volume errors.
Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
(cherry picked from commit b1570baadd
)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
54f75814d9
commit
3c78938494
1 changed files with 5 additions and 1 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue