diff --git a/src/pocketmine/updater/AutoUpdater.php b/src/pocketmine/updater/AutoUpdater.php index e9e12e208..9401dcb98 100644 --- a/src/pocketmine/updater/AutoUpdater.php +++ b/src/pocketmine/updater/AutoUpdater.php @@ -164,7 +164,7 @@ class AutoUpdater{ */ public function getChannel(){ $channel = strtolower($this->server->getProperty("auto-updater.preferred-channel", "stable")); - if($channel !== "stable" and $channel !== "beta" and $channel !== "development"){ + if($channel !== "stable" and $channel !== "beta" and $channel !== "alpha" and $channel !== "development"){ $channel = "stable"; } diff --git a/src/pocketmine/updater/UpdateCheckTask.php b/src/pocketmine/updater/UpdateCheckTask.php index d59330edf..99ef55874 100644 --- a/src/pocketmine/updater/UpdateCheckTask.php +++ b/src/pocketmine/updater/UpdateCheckTask.php @@ -51,17 +51,20 @@ class UpdateCheckTask extends AsyncTask{ if($response !== false){ $response = json_decode($response, true); if(is_array($response)){ - $this->setResult( - [ - "version" => $response["version"], - "api_version" => $response["api_version"], - "build" => $response["build"], - "date" => $response["date"], - "details_url" => $response["details_url"] ?? null, - "download_url" => $response["download_url"] - ], - true - ); + if( + isset($response["version"]) and + isset($response["api_version"]) and + isset($response["build"]) and + isset($response["date"]) and + isset($response["download_url"]) + ){ + $response["details_url"] = $response["details_url"] ?? null; + $this->setResult($response, true); + }elseif(isset($response["error"])){ + $this->error = $response["error"]; + }else{ + $this->error = "Invalid response data"; + } }else{ $this->error = "Invalid response data"; }