mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
add if to prevent crash
This commit is contained in:
parent
fd97190ee7
commit
3a20e4e15d
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue