Improve command check with method existence validation
This commit is contained in:
parent
47f47f2110
commit
69916fed3e
2 changed files with 3 additions and 1 deletions
|
@ -365,10 +365,11 @@
|
|||
/** @var UpdateEvent $eventHandler */
|
||||
foreach($this->eventHandlers as $eventHandler)
|
||||
{
|
||||
if(strtolower($eventHandler::getCommand()) === strtolower($command))
|
||||
if(method_exists($eventHandler, 'getCommand') && strtolower($eventHandler::getCommand()) === strtolower($command))
|
||||
{
|
||||
$results[] = $eventHandler;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $results;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue