Merge pull request #30090 from wangxing1517/fix-rename-error-when-sid-is-empty

Fix rename error when sid is empty
Upstream-commit: c06a82490400114d8f61670271ce5f84ffc14778
Component: engine
This commit is contained in:
Alexander Morozov
2017-01-27 10:01:50 -08:00
committed by GitHub
+1 -1
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