Skip to content

Commit

Permalink
Fix error for references with no clients
Browse files Browse the repository at this point in the history
  • Loading branch information
lluchs committed Dec 28, 2021
1 parent 4a3690c commit ae49dd4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/game.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ function to_json()

// PHP IIFE
'players' => call_user_func(function($clients) {
if ($clients === NULL) return array();
// Filter out clients with players.
$clients = array_filter($clients, function($client) {
return isset($client['[Player]']);
Expand Down

0 comments on commit ae49dd4

Please sign in to comment.