fix bug that makes servers unable to start because of no internet (#28)

useless fix but it's pretty much good enough for testing servers

---------

Co-authored-by: poggit-bot <poggitbot@gmail.com>
This commit is contained in:
Keenan Yafiq 2023-12-10 20:12:08 +07:00 committed by GitHub
parent 68941bd668
commit 4a643bbc4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,13 +15,13 @@ class FetchModelsTask extends AsyncTask {
}
public function onRun(): void {
$result = Internet::getURL("https://raw.githubusercontent.com/Matthww/PlayerInfo/master/resources/models.yml")->getBody();
if(!is_string($result)) {
$result = Internet::getURL("https://raw.githubusercontent.com/Matthww/PlayerInfo/master/resources/models.yml");
if(is_null($result)) {
$this->setResult(false);
return;
}
file_put_contents($this->path. "models.yml", $result);
file_put_contents($this->path. "models.yml", $result->getBody());
$this->setResult(true);
}
}