From f873d2304d87a47e7a3a2be16e57390e5a6eaac5 Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 24 Aug 2014 11:33:05 +0100 Subject: [PATCH] Check event handler exists before calling it, in case the cache is out of date. Fixes #442 --- core/util.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/util.inc.php b/core/util.inc.php index 6aafb1fe..6f510ca2 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -1308,7 +1308,9 @@ function send_event(Event $event) { ksort($my_event_listeners); foreach($my_event_listeners as $listener) { ctx_log_start(get_class($listener)); - $listener->$method_name($event); + if(method_exists($listener, $method_name)) { + $listener->$method_name($event); + } ctx_log_endok(); } $_event_count++;