From 918a0c03f53a19a45ec9a0099295fd33b2c95fbd Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 9 Mar 2015 09:04:37 +0100 Subject: [PATCH] Don't try to notify for peers who hasn't joined any room --- vroom.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/vroom.pl b/vroom.pl index c8044e2..1174aa5 100755 --- a/vroom.pl +++ b/vroom.pl @@ -1030,6 +1030,7 @@ websocket '/socket.io/:ver/websocket/:id' => sub { $self->app->log->debug("Client id " . $id . " closed websocket connection"); foreach my $peer (keys %$peers){ next if $peer eq $id; + next if !$peers->{$peer}->{room}; next if $peers->{$peer}->{room} ne $peers->{$id}->{room}; $self->app->log->debug("Notifying $peer that $id leaved"); $peers->{$peer}->{socket}->send(