diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomEndedInternalMsgHdlr.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomEndedInternalMsgHdlr.scala index ddc301ffe9..5438a879f9 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomEndedInternalMsgHdlr.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/apps/breakout/BreakoutRoomEndedInternalMsgHdlr.scala @@ -23,7 +23,17 @@ trait BreakoutRoomEndedInternalMsgHdlr { breakoutModel.removeRoom(msg.meetingId) } - state.update(updatedModel) + updatedModel match { + case Some(model) => + if (model.rooms.isEmpty) { + // All breakout rooms have ended + state.update(None) + } else { + state.update(Some(model)) + } + case None => + state + } } }