TimingsCommand: fixed crash on result handling

since AsyncTask->getResult() returns mixed, phpstan has no idea what is being returned here, so it doesn't report any errors.
This commit is contained in:
Dylan K. Taylor 2020-10-11 11:35:03 +01:00
parent e11dbf03e2
commit 46c57e4e24

View File

@ -163,7 +163,7 @@ class TimingsCommand extends VanillaCommand{
$sender->getServer()->getLogger()->logException($result);
return;
}
$response = json_decode($result[0], true);
$response = json_decode($result->getBody(), true);
if(is_array($response) && isset($response["id"])){
Command::broadcastCommandMessage($sender, new TranslationContainer("pocketmine.command.timings.timingsRead",
["https://" . $this->host . "/?id=" . $response["id"]]));