mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Added an exception throw for accessing permissions of closed players
This commit is contained in:
parent
c3fb2e9f23
commit
d588222e84
@ -465,8 +465,13 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
* @param permission\Permission|string $name
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @throws \InvalidStateException if the player is closed
|
||||
*/
|
||||
public function hasPermission($name){
|
||||
if($this->closed){
|
||||
throw new \InvalidStateException("Trying to get permissions of closed player");
|
||||
}
|
||||
return $this->perm->hasPermission($name);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user