[MIRROR] [s] Patches potential runtimes in AdminPM [MDB IGNORE] (#14845)

* [s] Patches potential runtimes in AdminPM (#68324)

About The Pull Request

Hey there,

6e29689 seemed to work alright on my end, but apparently there are cases where current_ticket.id = NULL. This would cause runtime trace errors that would start to list out the first few words of most adminhelps. Fuck.

You probably could use recipient.current_ticket.id on the "else" portion but I woke up to this and I'm not 100% certain if that will null out at this time. Might also be apt to revert #68215 entirely?
Why It's Good For The Game

Those shouldn't show up in runtimes!
Changelog

Nothing particularly player facing.

* [s] Patches potential runtimes in AdminPM

Co-authored-by: san7890 <the@san7890.com>
This commit is contained in:
SkyratBot
2022-07-10 22:13:44 -04:00
committed by GitHub
co-authored by san7890
parent 487a94234c
commit 9adea37b6b
+9 -2
View File
@@ -310,7 +310,11 @@
current_ticket.MessageNoRecipient(msg)
if(external)
log_admin_private("PM: Ticket #[current_ticket.id]: [key_name(src)]->External: [rawmsg]")
// Guard against the possibility of a null, since it'll runtime and spit out the contents of what should be a private ticket.
if(current_ticket)
log_admin_private("PM: Ticket #[current_ticket.id]: [key_name(src)]->External: [rawmsg]")
else
log_admin_private("PM: [key_name(src)]->External: [rawmsg]")
for(var/client/X in GLOB.admins)
to_chat(X,
type = MESSAGE_TYPE_ADMINPM,
@@ -318,7 +322,10 @@
confidential = TRUE)
else
window_flash(recipient, ignorepref = TRUE)
log_admin_private("PM: Ticket #[current_ticket.id]: [key_name(src)]->[key_name(recipient)]: [rawmsg]")
if(current_ticket)
log_admin_private("PM: Ticket #[current_ticket.id]: [key_name(src)]->[key_name(recipient)]: [rawmsg]")
else
log_admin_private("PM: [key_name(src)]->[key_name(recipient)]: [rawmsg]")
//we don't use message_admins here because the sender/receiver might get it too
for(var/client/X in GLOB.admins)
if(X.key!=key && X.key!=recipient.key) //check client/X is an admin and isn't the sender or recipient