From 7a5c58340718cf65d2ac037cf6b02b777c4659b4 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 15 Aug 2014 16:04:48 +0200 Subject: [PATCH] Throw exception when null chunk is passed to a Tile/Entity --- src/pocketmine/entity/Entity.php | 2 +- src/pocketmine/tile/Tile.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index e754e6c2e..b1e068c50 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -147,7 +147,7 @@ abstract class Entity extends Position implements Metadatable{ public function __construct(FullChunk $chunk, Compound $nbt){ - if($chunk->getProvider() === null){ + if($chunk === null or $chunk->getProvider() === null){ throw new \Exception("Invalid garbage Chunk given to Entity"); } diff --git a/src/pocketmine/tile/Tile.php b/src/pocketmine/tile/Tile.php index 0e47d40f8..b81246088 100644 --- a/src/pocketmine/tile/Tile.php +++ b/src/pocketmine/tile/Tile.php @@ -64,7 +64,7 @@ abstract class Tile extends Position{ public $tickTimer; public function __construct(FullChunk $chunk, Compound $nbt){ - if($chunk->getProvider() === null){ + if($chunk === null or $chunk->getProvider() === null){ throw new \Exception("Invalid garbage Chunk given to Tile"); }