Added continue in case of nil connection while disconnecting

This commit is contained in:
Trial97
2020-07-17 13:01:27 +03:00
committed by Dan Christian Bogos
parent 44f4388907
commit 68be0bf887

View File

@@ -91,6 +91,9 @@ func (self *KamailioAgent) Connect() (err error) {
func (self *KamailioAgent) Shutdown() (err error) {
for conIndx, conn := range self.conns {
if conn == nil {
continue
}
if err = conn.Disconnect(); err != nil {
utils.Logger.Err(fmt.Sprintf("<%s> can't disconnect connection at index %v because: %s",
utils.KamailioAgent, conIndx, err))