1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Check nil volume on mount init

Fixes #10685 panic in some cases.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff 2015-02-10 13:45:50 -05:00
parent f207dd5e7c
commit 7122b6643e

View file

@ -89,9 +89,10 @@ func (m *Mount) initialize() error {
// Make sure we remove these old volumes we don't actually want now.
// Ignore any errors here since this is just cleanup, maybe someone volumes-from'd this volume
v := m.container.daemon.volumes.Get(hostPath)
v.RemoveContainer(m.container.ID)
m.container.daemon.volumes.Delete(v.Path)
if v := m.container.daemon.volumes.Get(hostPath); v != nil {
v.RemoveContainer(m.container.ID)
m.container.daemon.volumes.Delete(v.Path)
}
}
// This is the full path to container fs + mntToPath