mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
HandlerList: fixed crash on getting unused priority
these sub-arrays are no longer allocated if no handlers are registered. fixes #5713
This commit is contained in:
parent
d06d3bc871
commit
84a16ce69a
@ -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{
|
||||
|
Loading…
x
Reference in New Issue
Block a user