Skip to content

An error should be thrown when an undefined scene is started #5811

@ubershmekel

Description

@ubershmekel

Version

  • Phaser Version: v3.55.2
  • Operating system: MacOS
  • Browser: Chrome

Description

When starting a scene with an invalid key, the command just kills the current scene with no error shown.

https://github.com/photonstorm/phaser/blob/5c8ecbcf999e6f328d21884e877c9e5935d2d350/src/scene/SceneManager.js#L1154

Seems there is no handling of the negative case of that if.

Example Test Code

When no such scene was registered in the GameConfig:

this.scene.start("game-over");

Additional Information

Would a PR to console log/warn be considered?

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