Player: fixed removeWindow() sometimes removing GUI / crashing clients

This commit is contained in:
Dylan K. Taylor 2019-02-24 12:14:19 +00:00
parent 79b7e08e60
commit 0c3b136a8d

View File

@ -3904,8 +3904,8 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
throw new \InvalidArgumentException("Cannot remove fixed window $id (" . get_class($inventory) . ") from " . $this->getName());
}
$inventory->close($this);
if($id !== null){
$inventory->close($this);
unset($this->windows[$hash], $this->windowIndex[$id], $this->permanentWindows[$id]);
}
}