Fix server crashing while crashing when trying to decode an invalid response from the crash-archive post

This commit is contained in:
Dylan K. Taylor 2017-06-17 10:31:20 +01:00
parent e0f8a02bb8
commit 1bae973502

View File

@ -2157,7 +2157,7 @@ class Server{
"reportPaste" => base64_encode($dump->getEncodedData()) "reportPaste" => base64_encode($dump->getEncodedData())
]); ]);
if(($data = json_decode($reply)) !== false and isset($data->crashId)){ if($reply !== false and ($data = json_decode($reply)) !== null and isset($data->crashId) and isset($data->crashUrl)){
$reportId = $data->crashId; $reportId = $data->crashId;
$reportUrl = $data->crashUrl; $reportUrl = $data->crashUrl;
$this->logger->emergency($this->getLanguage()->translateString("pocketmine.crash.archive", [$reportUrl, $reportId])); $this->logger->emergency($this->getLanguage()->translateString("pocketmine.crash.archive", [$reportUrl, $reportId]));