Elevated level close check to exception level

As an assertion, this will crash on save if the level is already closed due to the provider being null.
This commit is contained in:
Dylan K. Taylor 2017-03-30 19:41:10 +01:00
parent 69ac80518c
commit 40a6f4dee9

View File

@ -416,7 +416,9 @@ class Level implements ChunkManager, Metadatable{
}
public function close(){
assert(!$this->closed, "Tried to close a level which is already closed");
if($this->closed){
throw new \InvalidStateException("Tried to close a level which is already closed");
}
if($this->getAutoSave()){
$this->save();