From 3a20e4e15d27ab0061e5ffb427baf7162de9add9 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Mon, 8 Jul 2013 18:19:12 +0000 Subject: [PATCH] add if to prevent crash --- commands.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commands.go b/commands.go index f62f964621..0bd7965f7f 100644 --- a/commands.go +++ b/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) }