mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-14 22:01:59 +00:00
Fixed reference parameter fail in UpdateCheckTask, close #1048
not sure _why_ this doesn't work... maybe something to do with the old property being a member of a threaded object?
This commit is contained in:
parent
c43ab12a9a
commit
1aae9e03b6
@ -36,7 +36,7 @@ class UpdateCheckTask extends AsyncTask{
|
|||||||
/** @var string */
|
/** @var string */
|
||||||
private $channel;
|
private $channel;
|
||||||
/** @var string */
|
/** @var string */
|
||||||
private $error;
|
private $error = "Unknown error";
|
||||||
|
|
||||||
public function __construct(string $endpoint, string $channel){
|
public function __construct(string $endpoint, string $channel){
|
||||||
$this->endpoint = $endpoint;
|
$this->endpoint = $endpoint;
|
||||||
@ -44,11 +44,11 @@ class UpdateCheckTask extends AsyncTask{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onRun(){
|
public function onRun(){
|
||||||
$this->error = "";
|
$error = "";
|
||||||
$response = Utils::getURL($this->endpoint . "?channel=" . $this->channel, 4, [], $this->error);
|
$response = Utils::getURL($this->endpoint . "?channel=" . $this->channel, 4, [], $error);
|
||||||
if($this->error !== ""){
|
$this->error = $error;
|
||||||
return;
|
|
||||||
}else{
|
if($response !== false){
|
||||||
$response = json_decode($response, true);
|
$response = json_decode($response, true);
|
||||||
if(is_array($response)){
|
if(is_array($response)){
|
||||||
$this->setResult(
|
$this->setResult(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user