phaserjs / phaser

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
https://phaser.io
MIT License
37.16k stars 7.1k forks source link

Add PR to fix null pointer exception. #6816

Closed jacklehamster closed 3 months ago

jacklehamster commented 6 months ago

Please do not update the README or Change Log, we will do this when we merge your PR.

This PR (delete as applicable)

Describe the changes below:

Encountered the following null pointer exception:

Uncaught TypeError: Cannot set properties of undefined (setting 'controller')
    at FX.add (index.js:20011:39)
    at FX.addGlow (index.js:20023:27)
    at index.js:5204:132

This occurred only on Windows (VM on UTM, not sure if that made a difference) when trying to use special FX. This didn't happen on Mac.

The bug happened on all specials effects applied, on text or images (postFX.addGlow). See code: https://github.com/jacklehamster/phaser-game/blob/main/src/hischool/game.ts#L2372

zekeatchan commented 3 months ago

Hi @jacklehamster. Thanks for your PR, tested it and seems to be working fine. It's been merged with master branch