From 84a16ce69ae8b8880b2f3ff4e86fbedbe18348fe Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 21 Apr 2023 16:19:06 +0100 Subject: [PATCH] HandlerList: fixed crash on getting unused priority these sub-arrays are no longer allocated if no handlers are registered. fixes #5713 --- src/event/HandlerList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/event/HandlerList.php b/src/event/HandlerList.php index 692e8ac70..efbb20a1b 100644 --- a/src/event/HandlerList.php +++ b/src/event/HandlerList.php @@ -102,7 +102,7 @@ class HandlerList{ * @return RegisteredListener[] */ public function getListenersByPriority(int $priority) : array{ - return $this->handlerSlots[$priority]; + return $this->handlerSlots[$priority] ?? []; } public function getParent() : ?HandlerList{