Commit 6d07ab70458115a245a884ad86c45990b98044c3

Authored by Neil Blakey-Milner
1 parent 277ec8a2

Make sure we return an empty array if there are no triggers defined.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3997 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/triggers/triggerregistry.inc.php
... ... @@ -25,7 +25,16 @@ class KTTriggerRegistry {
25 25  
26 26 // {{{ getTriggers
27 27 function getTriggers($action, $slot) {
28   - return $this->triggers[$action][$slot];
  28 + $ret = array();
  29 + if (array_key_exists($action, $this->triggers)) {
  30 + if (array_key_exists($slot, $this->triggers[$action])) {
  31 + $ret = $this->triggers[$action][$slot];
  32 + }
  33 + }
  34 + if (empty($ret)) {
  35 + return array();
  36 + }
  37 + return $ret;
29 38 }
30 39 // }}}
31 40 }
... ...