mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
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:
parent
69ac80518c
commit
40a6f4dee9
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user