mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Fix rename error when sid is empty
Signed-off-by: Wang Xing <hzwangxing@corp.netease.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user