From b464cfa27702e2db6cbf8542c5c7019b2d2366e4 Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Tue, 7 May 2019 00:15:12 +0200 Subject: [PATCH] - fixed PHP Notice for invalid array key access --- app/Main/MapUpdate.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Main/MapUpdate.php b/app/Main/MapUpdate.php index f950c01..6c9f3c8 100644 --- a/app/Main/MapUpdate.php +++ b/app/Main/MapUpdate.php @@ -360,7 +360,14 @@ class MapUpdate implements MessageComponentInterface { * @return array */ private function getCharacterIdsByMapId(int $mapId) : array { - return is_array($this->subscriptions[$mapId]) ? array_keys($this->subscriptions[$mapId]) : []; + $characterIds = []; + if( + array_key_exists($mapId, $this->subscriptions) && + is_array($this->subscriptions[$mapId]) + ){ + $characterIds = array_keys($this->subscriptions[$mapId]); + } + return $characterIds; } /**