diff --git a/code/defines/procs/statistics.dm b/code/defines/procs/statistics.dm index 810bfb79aac..91d065e5279 100644 --- a/code/defines/procs/statistics.dm +++ b/code/defines/procs/statistics.dm @@ -47,9 +47,11 @@ proc/sql_report_death(var/mob/living/carbon/human/H) if(!H.key || !H.mind) return - var/turf/T = H.loc - var/area/placeofdeath = get_area(T.loc) - var/podname = placeofdeath.name + var/turf/T = get_turf(H) + var/area/placeofdeath = get_area(T) + var/podname = sanitizeSQL("Unknown Area") + if(placeofdeath) + podname = sanitizeSQL(placeofdeath.name) var/sqlname = sanitizeSQL(H.real_name) var/sqlkey = sanitizeSQL(H.key) @@ -82,9 +84,11 @@ proc/sql_report_cyborg_death(var/mob/living/silicon/robot/H) if(!H.key || !H.mind) return - var/turf/T = H.loc - var/area/placeofdeath = get_area(T.loc) - var/podname = placeofdeath.name + var/turf/T = get_turf(H) + var/area/placeofdeath = get_area(T) + var/podname = sanitizeSQL("Unknown Area") + if(placeofdeath) + podname = sanitizeSQL(placeofdeath.name) var/sqlname = sanitizeSQL(H.real_name) var/sqlkey = sanitizeSQL(H.key)