mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-14 11:42:27 +00:00
## About The Pull Request This PR adds a bunch of sanity checking to the `prefs.chat_toggles` var accesses. Prefs can be null when client is creating/deleting and this causes a runtime where you might not be able to use emotes.  EDIT: as per suggestion I stopped masking the issue and added stack traces instead. And made them into helper procs to avoid code duplication. For some of these procs it is important that we are able to continue running to get to the end. **A ghost having null prefs should not stop everyone else from hearing/seeing the emote.** So now they will put the stack trace and keep on trucking if that issue occurs. This is the main 'point' of the PR, which has seemingly gotten bogged down in the creation of the two helper procs--apologies. See https://github.com/tgstation/tgstation/pull/70404 for essentially the same issue but applied to chat messages. I have gone back and replaced the duplicated code from that to use the new helper procs instead. ## Why It's Good For The Game Anything chat related is a bad place to runtime. Some messages can take a while to type out and to have it not display is frustrating at worst, possibly detrimental if you have to communicate something urgently. ## Changelog 🆑 fix: fixes a bug that can cause emotes to stop working if a client is being created or deleted /🆑