rexrainbow / phaser3-rex-notes

Notes of phaser3 engine
MIT License
1.21k stars 262 forks source link

TextPlayer.destroy( ) nullpoint error #402

Closed yongzheng7 closed 6 months ago

yongzheng7 commented 7 months ago

Cannot set properties of null (setting 'clickTarget') TypeError: Cannot set properties of null (setting 'clickTarget') at set clickTarget [as clickTarget] (webpack-internal:///./node_modules/phaser3-rex-plugins/plugins/utils/managers/waiteventmanager/WaitEventManager.js:37:33) at WaitEventManager.setClickTarget (webpack-internal:///./node_modules/phaser3-rex-plugins/plugins/utils/managers/waiteventmanager/WaitInputMethods.js:12:26) at WaitEventManager.destroy (webpack-internal:///./node_modules/phaser3-rex-plugins/plugins/utils/managers/waiteventmanager/WaitEventManager.js:50:14) at TextPlayer.DestroyManagers [as destroyManagers] (webpack-internal:///./node_modules/phaser3-rex-plugins/plugins/utils/managers/DestroyManagers.js:6:27) at TextPlayer.destroy (webpack-internal:///./node_modules/phaser3-rex-plugins/plugins/gameobjects/dynamictext/textplayer/TextPlayer.js:100:14) at guideDestroy (webpack-internal:///./src/utils/GuideHelper.ts:143:29) at destroy (webpack-internal:///./src/utils/GuideHelper.ts:156:25) at ControllerScript.eval [as callback] (webpack-internal:///./src/utils/GuideHelper.ts:167:29) at ControllerScript.onListener (webpack-internal:///./src/base/ControllerScript.ts:26:27) at Text.emit (webpack-internal:///./node_modules/phaser/dist/phaser.js:196:35)

The destroy() method in the WaitEventManager class will first execute super. destroy() and this. parent=null; Causing this. parent to be null, causing this. setClickTarget() to be executed in WaitEventManager; This. setCameraTarget(); Trigger null pointer exception

rexrainbow commented 7 months ago

Thanks for this bug report. It has been fixed in this commit. NPM package will be upgraded at end of this month.