mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 22:45:28 +00:00
Player::getNetworkSession() now explicitly handles disconnected state by throwing an exception
instead of just allowing return of possibly-null networkSession
This commit is contained in:
parent
3ef2a19527
commit
5e73417fa9
@ -530,6 +530,9 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
}
|
||||
|
||||
public function getNetworkSession() : NetworkSession{
|
||||
if($this->networkSession === null){
|
||||
throw new \InvalidStateException("Player is not connected");
|
||||
}
|
||||
return $this->networkSession;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user