Skip to content

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

@jf-m

Description

@jf-m

This Issue is about

  • A bug in the API:
    • Phaser version(s): 2.15.0
    • Live example: /
    • What steps produce the bug: Load and destroy the scene before the loader has finised loading the assets
    • What should happen: No error should be thrown
    • What happens instead: An error is thrown
    • If there's an error:
      • What's the error message?Cannot read property 'loadUpdate' of null
      • What's the error trace (expand the error message)? Phaser.Loader.finishedLoading

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions