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:
Dylan K. Taylor 2017-06-09 19:51:18 +01:00
parent c43ab12a9a
commit 1aae9e03b6

View File

@ -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(