Skip to content

Commit e2a6b85

Browse files
author
Shlomi Noach
authored
Merge branch 'master' into drop-add-same-column
2 parents 7f62efb + de349a7 commit e2a6b85

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

go/logic/server.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,13 @@ func (this *Server) Serve() (err error) {
9898
}
9999

100100
func (this *Server) handleConnection(conn net.Conn) (err error) {
101-
defer conn.Close()
101+
if conn != nil {
102+
defer conn.Close()
103+
}
102104
command, _, err := bufio.NewReader(conn).ReadLine()
105+
if err != nil {
106+
return err
107+
}
103108
return this.onServerCommand(string(command), bufio.NewWriter(conn))
104109
}
105110

0 commit comments

Comments
 (0)