Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ubershmekel opened this issue Aug 15, 2021 · 1 comment · Fixed by #5825
Closed

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

ubershmekel opened this issue Aug 15, 2021 · 1 comment · Fixed by #5825

Comments

@ubershmekel
Copy link
Contributor

ubershmekel commented Aug 15, 2021

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?

ubershmekel added a commit to ubershmekel/phaser that referenced this issue Sep 4, 2021
photonstorm added a commit that referenced this issue Sep 20, 2021
Fix #5811, log error on invalid scene.start(key)
@photonstorm
Copy link
Collaborator

Thanks for opening this issue, and for submitting a PR to fix it. We have merged your PR into the master branch and attributed the work to you in the Change Log. If you need to tweak the code for whatever reason please submit a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants