Browse Source

add if to prevent crash

Victor Vieux 12 năm trước cách đây
mục cha
commit
3a20e4e15d
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      commands.go

+ 3 - 0
commands.go

@@ -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)
 }