mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 07:54:19 +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
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function dispatchCommand(CommandSender $sender, $commandLine){
|
||||
if(!($sender instanceof CommandSender)){
|
||||
throw new \Exception("CommandSender is not valid");
|
||||
}
|
||||
|
||||
if($this->commandMap->dispatch($sender, $commandLine)){
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user