check for nil listener before close

This commit is contained in:
Bradley Cicenas
2017-02-18 03:37:00 +00:00
parent 0e8480ce5d
commit db050031df
2 changed files with 8 additions and 6 deletions

View File

@ -44,7 +44,9 @@ func StartServer() {
func StopServer() {
server.wg.Wait()
server.ln.Close()
if server.ln != nil {
server.ln.Close()
}
}
func handler(conn net.Conn) {