add if to prevent crash
Upstream-commit: 3a20e4e15d27ab0061e5ffb427baf7162de9add9 Component: engine
This commit is contained in:
@@ -1516,6 +1516,9 @@ func (cli *DockerCli) getTtySize() (int, int) {
|
||||
ws, err := term.GetWinsize(cli.terminalFd)
|
||||
if err != nil {
|
||||
utils.Debugf("Error getting size: %s", err)
|
||||
if ws == nil {
|
||||
return 0, 0
|
||||
}
|
||||
}
|
||||
return int(ws.Height), int(ws.Width)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user