diff --git a/build.sh b/build.sh index 4e72fe1..d5c0888 100755 --- a/build.sh +++ b/build.sh @@ -1,3 +1,3 @@ #!/bin/bash -docker build -t builder .&& docker run --rm builder | sudo docker build -t franela/play-with-docker:master - +docker build -t builder .&& docker run --rm builder | sudo docker build -t franela/play-with-docker:latest - diff --git a/services/client.go b/services/client.go index b805e70..d8a5756 100644 --- a/services/client.go +++ b/services/client.go @@ -25,7 +25,7 @@ func NewClient(so socketio.Socket, session *Session) *Client { so.On("terminal in", func(name, data string) { // User wrote something on the terminal. Need to write it to the instance terminal instance := GetInstance(session, name) - if len(data) > 0 { + if instance != nil && len(data) > 0 { instance.Conn.Conn.Write([]byte(data)) } })