From baf15f25a72876d4048daf2cca6a837d4fe961e5 Mon Sep 17 00:00:00 2001 From: SabreML <57483089+SabreML@users.noreply.github.com> Date: Sun, 1 Aug 2021 12:31:43 +0100 Subject: [PATCH] Fixes runtimes caused by null client preferences (#16464) * Client check * Skip character randomisation --- code/modules/client/preference/preferences_mysql.dm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/modules/client/preference/preferences_mysql.dm b/code/modules/client/preference/preferences_mysql.dm index 77f11729293..0f589cabaf3 100644 --- a/code/modules/client/preference/preferences_mysql.dm +++ b/code/modules/client/preference/preferences_mysql.dm @@ -126,10 +126,11 @@ qdel(query) return 1 -/datum/preferences/proc/load_character(client/C,slot) +/datum/preferences/proc/load_character(client/C, slot) saved = FALSE - if(!slot) slot = default_slot + if(!slot) + slot = default_slot slot = sanitize_integer(slot, 1, max_save_slots, initial(default_slot)) if(slot != default_slot) default_slot = slot @@ -142,6 +143,10 @@ return qdel(firstquery) + if(!C) // If the client disconnected during the query, try again later. + qdel(src) + return TRUE + // Let's not have this explode if you sneeze on the DB var/datum/db_query/query = SSdbcore.NewQuery({"SELECT OOC_Notes,