From 1bc54f7141921e065d582847f136b3e6abf509d4 Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Sun, 22 Dec 2019 18:31:57 -0500 Subject: [PATCH] skip games without registered users --- modules/relation/src/main/RelationActor.scala | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/relation/src/main/RelationActor.scala b/modules/relation/src/main/RelationActor.scala index 4b2f82dabb..b82bee67b8 100644 --- a/modules/relation/src/main/RelationActor.scala +++ b/modules/relation/src/main/RelationActor.scala @@ -64,14 +64,16 @@ final private[relation] class RelationActor( } mon (_.relation.actor.reloadFriends) case lila.game.actorApi.FinishGame(game, _, _) if game.hasClock => - val usersPlaying = game.userIds - online.playing removeAll usersPlaying - notifyFollowersGameStateChanged(usersPlaying, "following_stopped_playing") + game.userIds.some.filter(_.nonEmpty) foreach { usersPlaying => + online.playing removeAll usersPlaying + notifyFollowersGameStateChanged(usersPlaying, "following_stopped_playing") + } case lila.game.actorApi.StartGame(game) if game.hasClock => - val usersPlaying = game.userIds - online.playing putAll usersPlaying - notifyFollowersGameStateChanged(usersPlaying, "following_playing") + game.userIds.some.filter(_.nonEmpty) foreach { usersPlaying => + online.playing putAll usersPlaying + notifyFollowersGameStateChanged(usersPlaying, "following_playing") + } case lila.hub.actorApi.study.StudyDoor(userId, studyId, contributor, public, true) => online.studyingAll.put(userId, studyId)