fixed crash on dev build self-shutdown

This commit is contained in:
Dylan K. Taylor 2019-01-22 13:38:50 +00:00
parent 48a99937b9
commit 1ebc101ded

View File

@ -1710,9 +1710,11 @@ class Server{
$player->close($player->getLeaveMessage(), $this->getProperty("settings.shutdown-message", "Server closed"));
}
$this->getLogger()->debug("Unloading all levels");
foreach($this->levelManager->getLevels() as $level){
$this->levelManager->unloadLevel($level, true);
if($this->levelManager instanceof LevelManager){
$this->getLogger()->debug("Unloading all levels");
foreach($this->levelManager->getLevels() as $level){
$this->levelManager->unloadLevel($level, true);
}
}
$this->getLogger()->debug("Removing event handlers");