mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-05 05:01:28 +00:00
add if to prevent crash
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