From 6282f7367e82a5628ad678aeb8359061074cbe72 Mon Sep 17 00:00:00 2001 From: nao20010128nao Date: Thu, 10 Sep 2015 23:19:55 +0900 Subject: [PATCH] Fixed to prevent an error --- src/SimpleAuth/task/ShowMessageTask.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/SimpleAuth/task/ShowMessageTask.php b/src/SimpleAuth/task/ShowMessageTask.php index 7ea52a1..4a1be52 100644 --- a/src/SimpleAuth/task/ShowMessageTask.php +++ b/src/SimpleAuth/task/ShowMessageTask.php @@ -39,11 +39,11 @@ public function getPlugin(){ } public function addPlayer(Player $player){ - $this->playerList[$player->getUniqueId()] = $player; + $this->playerList[spl_object_hash($player->getUniqueId())] = $player; } public function removePlayer(Player $player){ - unset($this->playerList[$player->getUniqueId()]); + $this->playerList[spl_object_hash($player->getUniqueId())] = null; } public function onRun($currentTick){ @@ -53,8 +53,10 @@ public function onRun($currentTick){ } foreach($this->playerList as $player){ + if($player==null){ + continue; + } $player->sendPopup(TextFormat::ITALIC . TextFormat::GRAY . $this->getPlugin()->getMessage("join.popup")); } } - -} \ No newline at end of file +}