mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 23:59:53 +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[]
|
* @return RegisteredListener[]
|
||||||
*/
|
*/
|
||||||
public function getListenersByPriority(int $priority) : array{
|
public function getListenersByPriority(int $priority) : array{
|
||||||
return $this->handlerSlots[$priority];
|
return $this->handlerSlots[$priority] ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getParent() : ?HandlerList{
|
public function getParent() : ?HandlerList{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user