diff --git a/README.md b/README.md index 185e984..7ccf92f 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ Check out the **[contributing wiki](https://github.com/pion/webrtc/wiki/Contribu * [Jason Maldonis](https://github.com/jjmaldonis) * [Nevio Vesic](https://github.com/0x19) * [David Hamilton](https://github.com/dihamilton) +* [adwpc](https://github.com/adwpc) ### License MIT License - see [LICENSE](LICENSE) for full text diff --git a/gather.go b/gather.go index 2c8dbb8..42c3a35 100644 --- a/gather.go +++ b/gather.go @@ -22,6 +22,11 @@ type closeable interface { // Close a net.Conn and log if we have a failure func closeConnAndLog(c closeable, log logging.LeveledLogger, msg string) { + if c == nil { + log.Warnf("Conn is not allocated") + return + } + log.Warnf(msg) if err := c.Close(); err != nil { log.Warnf("Failed to close conn: %v", err)