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

Fix rename error when sid is empty

Signed-off-by: Wang Xing <hzwangxing@corp.netease.com>
This commit is contained in:
Wang Xing 2017-01-11 21:31:45 +08:00
parent 24e9ac1575
commit b9ab129554

View file

@ -106,7 +106,7 @@ func (daemon *Daemon) ContainerRename(oldName, newName string) error {
}()
sid = container.NetworkSettings.SandboxID
if daemon.netController != nil {
if sid != "" && daemon.netController != nil {
sb, err = daemon.netController.SandboxByID(sid)
if err != nil {
return err