Skip to content

Commit 3ea650c

Browse files
committed
Check if the events for a given section exist - else return an empty array
1 parent 4c832ce commit 3ea650c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Client.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,10 @@ public function getDefaultMessageMask(): string {
655655
* @return array
656656
*/
657657
public function getDefaultEvents($section): array {
658-
return $this->events[$section];
658+
if (isset($this->events[$section])) {
659+
return is_array($this->events[$section]) ? $this->events[$section] : [];
660+
}
661+
return [];
659662
}
660663

661664
/**

0 commit comments

Comments
 (0)