Skip to content

Commit

Permalink
Fixed controller toggleResource issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jsanahuja committed Apr 14, 2021
1 parent f03f5ea commit 1b96864
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ public function message($client, $message){

public function toggleResource($client, $resource){
if($client->toggleResource($resource)){
$client->getRoom()->getSocket($this->io)->emit("r_resource", $client->getPublicInfo(), $client->getResources());
$room = $client->getRoom();
if($room !== false){
$room->getSocket($this->io)->emit("r_resource", $client->getPublicInfo(), $client->getResources());
}
}
}

Expand Down

0 comments on commit 1b96864

Please sign in to comment.