Files
Bubberstation/code/modules/modular_computers/file_system/programs
Bloop ed8445a312 Adds sanity checking to prefs checks, fixing a bug that can cause emotes to stop displaying intermittently (#76946)
## 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.


![image](https://github.com/tgstation/tgstation/assets/13398309/d89649d4-19c7-439f-b080-332709196505)

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
/🆑
2023-08-14 22:30:35 +02:00
..