Error when calling phaserGame.destroy(true)

When I try to call phaserGame.destroy(true) on my game, I get the following JS error:

Uncaught TypeError: Cannot read property 'update' of null
    at MatterPhysics.shutdown (MatterPhysics.js?4380:309)
    at MatterPhysics.destroy (MatterPhysics.js?4380:330)
    at EventEmitter.emit (index.js?ba10:202)
    at Systems.destroy (Systems.js?9339:747)
    at SceneManager.destroy (SceneManager.js?cec0:1607)
    at Game.runDestroy (Game.js?22d5:673)
    at Game.step (Game.js?22d5:460)
    at TimeStep.step (TimeStep.js?fdd3:550)
    at step (RequestAnimationFrame.js?7d37:105)

Looking at the line number in MatterPhysics.js, it looks like this.world is already null.

eventEmitter.off(SceneEvents.UPDATE, this.world.update, this.world);

I had found this old topic of how to destroy a Phaser 3 game: http://www.html5gamedevs.com/topic/32563-whats-the-proper-way-to-destroy-a-phaser-3-game-instance/

Using “Phaser v3.17.0-FB (WebGL | Web Audio)”

Can you post more of your code? Maybe a link to the source?

No problem, here’s a Fiddle that reproduces the issue: https://jsfiddle.net/o8eg5zyn/
Just click “Destroy” to see the JS error in your console.

I noticed it doesn’t happen when there is only one scene. It happens when there was a BootScene that loaded the PlayScene.

That may be a Phaser bug, Arcade Physics had a similar problem.