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
|
@ -10,6 +10,7 @@ This update introduces bug fixes and improvements
|
|||
|
||||
### Fixed
|
||||
* Reposition debug log for event handler execution.
|
||||
* Improve command check with method existence validation
|
||||
|
||||
|
||||
## [8.0.0] - 2024-11-29
|
||||
|
|
|
@ -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
Reference in a new issue