Fix panic when closing room (#1428)
This commit is contained in:
@@ -419,13 +419,13 @@ func (r *RoomManager) getOrCreateRoom(ctx context.Context, roomName livekit.Room
|
|||||||
currentRoom := r.rooms[roomName]
|
currentRoom := r.rooms[roomName]
|
||||||
for currentRoom != lastSeenRoom {
|
for currentRoom != lastSeenRoom {
|
||||||
r.lock.Unlock()
|
r.lock.Unlock()
|
||||||
if currentRoom.Hold() {
|
if currentRoom != nil && currentRoom.Hold() {
|
||||||
return currentRoom, nil
|
return currentRoom, nil
|
||||||
} else {
|
|
||||||
lastSeenRoom = currentRoom
|
|
||||||
r.lock.Lock()
|
|
||||||
currentRoom = r.rooms[roomName]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastSeenRoom = currentRoom
|
||||||
|
r.lock.Lock()
|
||||||
|
currentRoom = r.rooms[roomName]
|
||||||
}
|
}
|
||||||
|
|
||||||
// construct ice servers
|
// construct ice servers
|
||||||
|
|||||||
Reference in New Issue
Block a user