From b5f473a3df5459620dcf1f9feef27b7e437da822 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 31 Mar 2017 13:14:05 +0100 Subject: [PATCH] Throw an exception when attempting to tick closed Levels --- src/pocketmine/level/Level.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index 0ad2e7fbc..25acf601d 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -645,6 +645,9 @@ class Level implements ChunkManager, Metadatable{ * */ public function doTick(int $currentTick){ + if($this->closed){ + throw new \InvalidStateException("Attempted to tick a Level which has been closed"); + } $this->timings->doTick->startTiming();