mirror of
https://github.com/kataras/iris.git
synced 2025-12-20 03:17:04 +00:00
Fixed fireOnLeave when connection is already closed
Former-commit-id: 664afda8f052b9c7596f82d66cc4faeb6e09148d
This commit is contained in:
committed by
GitHub
parent
501c9d18d9
commit
9da7bdb27d
@@ -477,6 +477,10 @@ func (c *connection) OnLeave(roomLeaveCb LeaveRoomFunc) {
|
||||
}
|
||||
|
||||
func (c *connection) fireOnLeave(roomName string) {
|
||||
// check if connection is already closed
|
||||
if c == nil {
|
||||
return
|
||||
}
|
||||
// fire the onRoomLeaveListeners
|
||||
for i := range c.onRoomLeaveListeners {
|
||||
c.onRoomLeaveListeners[i](roomName)
|
||||
|
||||
Reference in New Issue
Block a user