Add null checks to client prefs checks

client.prefs. -> client?.prefs?.
This commit is contained in:
psq95
2023-05-13 23:53:47 +01:00
parent dfeb85bfa4
commit 5840c8ab99
93 changed files with 310 additions and 310 deletions
@@ -181,7 +181,7 @@ GLOBAL_LIST_EMPTY(antagonists)
/datum/antagonist/proc/enabled_in_preferences(datum/mind/M)
if(job_rank)
if(M.current && M.current.client && (job_rank in M.current.client.prefs.be_special))
if(M.current && M.current.client && (job_rank in M.current.client?.prefs?.be_special))
return TRUE
else
return FALSE
@@ -192,7 +192,7 @@ GLOBAL_LIST_EMPTY(blob_nodes)
return
if (src.client)
if(client.prefs.muted & MUTE_IC)
if(client?.prefs?.muted & MUTE_IC)
to_chat(src, "You cannot send IC messages (muted).")
return
if (src.client.handle_spam_prevention(message,MUTE_IC))
@@ -80,7 +80,7 @@
/mob/camera/eminence/say(message, bubble_type, var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null)
if(client)
if(client.prefs.muted & MUTE_IC)
if(client?.prefs?.muted & MUTE_IC)
to_chat(src, "You cannot send IC messages (muted).")
return
if(client.handle_spam_prevention(message,MUTE_IC))
@@ -286,7 +286,7 @@
var/list/datum/mind/promotable = list()
for(var/datum/mind/khrushchev in non_heads)
if(khrushchev.current && !khrushchev.current.incapacitated() && !khrushchev.current.restrained() && khrushchev.current.client && khrushchev.current.stat != DEAD)
if(ROLE_REV in khrushchev.current.client.prefs.be_special)
if(ROLE_REV in khrushchev.current.client?.prefs?.be_special)
promotable += khrushchev
if(promotable.len)
var/datum/mind/new_leader = pick(promotable)