diff options
-rw-r--r-- | core/EventDispatcher.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/EventDispatcher.php b/core/EventDispatcher.php index d343da8beb..bdec8c1c7c 100644 --- a/core/EventDispatcher.php +++ b/core/EventDispatcher.php @@ -90,6 +90,11 @@ class EventDispatcher extends Singleton $plugin = $this->getPluginManager()->getLoadedPlugin($plugin); } + if (empty($plugin)) { + return; // may happen in unit tests + } + + $hooks = $plugin->getListHooksRegistered(); if (isset($hooks[$eventName])) { |