diff --git a/src/pocketmine/updater/UpdateCheckTask.php b/src/pocketmine/updater/UpdateCheckTask.php index 2821e41be..d59330edf 100644 --- a/src/pocketmine/updater/UpdateCheckTask.php +++ b/src/pocketmine/updater/UpdateCheckTask.php @@ -36,7 +36,7 @@ class UpdateCheckTask extends AsyncTask{ /** @var string */ private $channel; /** @var string */ - private $error; + private $error = "Unknown error"; public function __construct(string $endpoint, string $channel){ $this->endpoint = $endpoint; @@ -44,11 +44,11 @@ class UpdateCheckTask extends AsyncTask{ } public function onRun(){ - $this->error = ""; - $response = Utils::getURL($this->endpoint . "?channel=" . $this->channel, 4, [], $this->error); - if($this->error !== ""){ - return; - }else{ + $error = ""; + $response = Utils::getURL($this->endpoint . "?channel=" . $this->channel, 4, [], $error); + $this->error = $error; + + if($response !== false){ $response = json_decode($response, true); if(is_array($response)){ $this->setResult(