monoclex / smiley-face-game

https://smiley-face-game.sirjosh3917.com/
GNU Affero General Public License v3.0
8 stars 0 forks source link

Fix weird bug when players leave #174

Closed monoclex closed 2 years ago

monoclex commented 2 years ago

Seems to be an exception when players leave,

Uncaught (in promise) Error: The supplied DisplayObject must be a child of the caller
    at e.getChildIndex (83.js:2:192945)
    at 990.js:1:20013
    at main.js?b3738fc21c2cf5836089:29:52295
    at Array.forEach (<anonymous>)
    at Object.emit (main.js?b3738fc21c2cf5836089:29:52283)
    at De.remove (main.js?b3738fc21c2cf5836089:29:71012)
    at Me.handleEvent (main.js?b3738fc21c2cf5836089:29:72968)
    at 990.js:1:53853

It causes a snow-ball effect of errors

An unknown kind of error occurred. Report this to our development team in bug-reports on discord.
Cannot read properties of undefined (reading 'role')
TypeError: Cannot read properties of undefined (reading 'role') at Pt (https://dev-smiley-face-game.sirjosh3917.com/990.js:1:40230) at aa (https://dev-smiley-face-game.sirjosh3917.com/main.js?b3738fc21c2cf5836089:29:298405) at Fa (https://dev-smiley-face-game.sirjosh3917.com/main.js?b3738fc21c2cf5836089:29:307923) at Ws (https://dev-smiley-face-game.sirjosh3917.com/main.js?b3738fc21c2cf5836089:29:351428) at Ol (https://dev-smiley-face-game.sirjosh3917.com/main.js?b3738fc21c2cf5836089:29:337728) at xl (https://dev-smiley-face-game.sirjosh3917.com/main.js?b3738fc21c2cf5836089:29:337656) at El (https://dev-smiley-face-game.sirjosh3917.com/main.js?b3738fc21c2cf5836089:29:337519) at yl (https://dev-smiley-face-game.sirjosh3917.com/main.js?b3738fc21c2cf5836089:29:334506) at https://dev-smiley-face-game.sirjosh3917.com/main.js?b3738fc21c2cf5836089:29:284327 at t.unstable_runWithPriority (https://dev-smiley-face-game.sirjosh3917.com/main.js?b3738fc21c2cf5836089:29:456549)