phaserjs / phaser-ce

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

`Cannot read property 'loadUpdate' of null` when destroying the game too early #666

Closed jf-m closed 4 years ago

jf-m commented 4 years ago

This Issue is about


Hello and thank you for maintaining this repo !

This problem comes from the following line : https://github.com/photonstorm/phaser-ce/blob/8f6296def883334faefa4aaf618c81eac4c3a7f3/src/loader/Loader.js#L2181

I think an if statement should be placed at this place, exactly the same way as 3 lines after :

https://github.com/photonstorm/phaser-ce/blob/8f6296def883334faefa4aaf618c81eac4c3a7f3/src/loader/Loader.js#L2188-L2192

Indeed, the case is well handled on loadComplete but not on loadUpdate.

Thank you very much, hope this helps