mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-12 12:55:21 +00:00
Throw exception when Server::dispatchCommand() is called with an invalid CommandSender
This commit is contained in:
parent
ae54426836
commit
5404ba77d0
@ -1714,8 +1714,14 @@ class Server{
|
|||||||
* @param string $commandLine
|
* @param string $commandLine
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
|
*
|
||||||
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function dispatchCommand(CommandSender $sender, $commandLine){
|
public function dispatchCommand(CommandSender $sender, $commandLine){
|
||||||
|
if(!($sender instanceof CommandSender)){
|
||||||
|
throw new \Exception("CommandSender is not valid");
|
||||||
|
}
|
||||||
|
|
||||||
if($this->commandMap->dispatch($sender, $commandLine)){
|
if($this->commandMap->dispatch($sender, $commandLine)){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user