mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-13 13:25:16 +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
|
* @param permission\Permission|string $name
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
|
*
|
||||||
|
* @throws \InvalidStateException if the player is closed
|
||||||
*/
|
*/
|
||||||
public function hasPermission($name){
|
public function hasPermission($name){
|
||||||
|
if($this->closed){
|
||||||
|
throw new \InvalidStateException("Trying to get permissions of closed player");
|
||||||
|
}
|
||||||
return $this->perm->hasPermission($name);
|
return $this->perm->hasPermission($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user