pixijs/layers

InteractionCallback getting passed as null to pixi layers findHit, resulting in error

Redmega opened this issue · 1 comments

plugins.interaction.hitTest sends null for the InteractionCallback of processInteractive, which in turn drills down to @pixi/layers this._finishInteractionProcess which calls it without actually checking that it exists/is callable.

https://github.com/pixijs/pixi-layers/blob/75c4078445b30f27cca153cfb931e37bff734edd/src/LayersTreeSearch.ts#L180-L182

You check that func exists when processing the second queue item, but not the first. Is this just an oversight or is there a reason for that?

If you look at the same function in the v5 branch, it seems like it's much more careful about what it's passed:
https://github.com/pixijs/pixi-layers/blob/4b5b29d6f1770fb0d40f21848bd7b35e00a6a931/src/LayersTreeSearch.ts#L153-L163

Closed by #77