mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
SendUsageTask: explicitly assume that json_encode() will not return false
This commit is contained in:
parent
88b216a17b
commit
755919c496
@ -25,6 +25,7 @@ namespace pocketmine\scheduler;
|
||||
|
||||
use pocketmine\network\mcpe\protocol\ProtocolInfo;
|
||||
use pocketmine\Server;
|
||||
use pocketmine\utils\AssumptionFailedError;
|
||||
use pocketmine\utils\Internet;
|
||||
use pocketmine\utils\Process;
|
||||
use pocketmine\utils\Utils;
|
||||
@ -152,7 +153,9 @@ class SendUsageTask extends AsyncTask{
|
||||
}
|
||||
|
||||
$this->endpoint = $endpoint . "api/post";
|
||||
$this->data = json_encode($data/*, JSON_PRETTY_PRINT*/);
|
||||
$data = json_encode($data/*, JSON_PRETTY_PRINT*/);
|
||||
if($data === false) throw new AssumptionFailedError("Statistics JSON should never fail to encode: " . json_last_error_msg());
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
public function onRun(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user