Skip to content

Commit

Permalink
Merge pull request #27 from abligh/fix-null-datagram-address
Browse files Browse the repository at this point in the history
Fix null datagram address
  • Loading branch information
mcuadros committed Mar 12, 2016
2 parents 31f917c + 429245c commit e75d991
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,11 @@ func (s *Server) goReceiveDatagrams(connection net.Conn) {
for ; (n > 0) && (buf[n-1] < 32); n-- {
}
if n > 0 {
s.datagramChannel <- DatagramMessage{buf[:n], addr.String()}
var address string
if addr != nil {
address = addr.String()
}
s.datagramChannel <- DatagramMessage{buf[:n], address}
}
} else {
// there has been an error. Either the server has been killed
Expand Down

0 comments on commit e75d991

Please sign in to comment.