mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 19:59:11 +00:00
Merge branch 'next-minor'
# Conflicts: # resources/vanilla # src/plugin/PluginBase.php # src/plugin/PluginDescription.php # src/pocketmine/Player.php # src/pocketmine/network/rcon/RCON.php # src/pocketmine/network/rcon/RCONInstance.php # src/pocketmine/scheduler/AsyncTask.php # src/pocketmine/tile/Spawnable.php # src/scheduler/AsyncPool.php # src/utils/Config.php # src/utils/Timezone.php # src/utils/UUID.php # src/utils/Utils.php # src/world/format/io/region/RegionLoader.php
This commit is contained in:
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\scheduler;
|
||||
|
||||
use pocketmine\utils\AssumptionFailedError;
|
||||
use function is_scalar;
|
||||
use function serialize;
|
||||
use function spl_object_id;
|
||||
@@ -105,7 +106,11 @@ abstract class AsyncTask extends \Threaded{
|
||||
* @return mixed
|
||||
*/
|
||||
public function getResult(){
|
||||
return $this->serialized ? unserialize($this->result) : $this->result;
|
||||
if($this->serialized){
|
||||
if(!is_string($this->result)) throw new AssumptionFailedError("Result expected to be a serialized string");
|
||||
return unserialize($this->result);
|
||||
}
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
public function cancelRun() : void{
|
||||
|
Reference in New Issue
Block a user