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

stopFollow() throws Cannot read properties of null Error #6508

Closed
francois-dibulo opened this issue May 21, 2023 · 1 comment
Closed

stopFollow() throws Cannot read properties of null Error #6508

francois-dibulo opened this issue May 21, 2023 · 1 comment

Comments

@francois-dibulo
Copy link
Contributor

Version

  • Phaser Version: 3.6.0
  • Operating system: Mac Ventura 13.2
  • Browser: Tested on Chrome 113

Description

Calling gameObject.stopFollow() throws an error:

TypeError: Cannot read properties of null (reading '0')
    at PathFollower.pathUpdate (PathFollower.js:364:1)
    at PathFollower.preUpdate (PathFollower.js:71:1)
    at UpdateList.sceneUpdate (UpdateList.js:156:1)
    at EventEmitter.emit (index.js:203:1)
    at Systems.step (Systems.js:362:1)
    at SceneManager.update (SceneManager.js:574:1)
    at Game.step (Game.js:498:1)
    at TimeStep.step (TimeStep.js:727:1)
    at step (RequestAnimationFrame.js:91:1)
    at spector.bundle.js:1:594101 Array(0)

Example Test Code

You can reproduce the error in the official labs example:

https://labs.phaser.io/edit.html?src=src/paths/followers/pause%20and%20resume.js

Replace:

lemming.pauseFollow(); with lemming.stopFollow();

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

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

No branches or pull requests

2 participants