diff --git a/code/datums/spell.dm b/code/datums/spell.dm
index 29fe4dfd7ed..f717b4534e4 100644
--- a/code/datums/spell.dm
+++ b/code/datums/spell.dm
@@ -176,7 +176,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
/obj/effect/proc_holder/spell/proc/perform(list/targets, recharge = 1, mob/user = usr) //if recharge is started is important for the trigger spells
before_cast(targets)
invocation(user)
- if(user.ckey)
+ if(user && user.ckey)
user.attack_log += text("\[[time_stamp()]\] [user.real_name] ([user.ckey]) cast the spell [name].")
spawn(0)
if(charge_type == "recharge" && recharge)
diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm
index fe21e018bd8..43d2b2f6ae7 100644
--- a/code/game/gamemodes/revolution/revolution.dm
+++ b/code/game/gamemodes/revolution/revolution.dm
@@ -192,7 +192,7 @@
if(khrushchev.current && khrushchev.current.client && khrushchev.current.stat != DEAD)
if(ROLE_REV in khrushchev.current.client.prefs.be_special)
promotable_revs += khrushchev
- if(promotable_revs)
+ if(promotable_revs.len)
var/datum/mind/stalin = pick(promotable_revs)
revolutionaries -= stalin
head_revolutionaries += stalin
diff --git a/code/game/mecha/equipment/tools/mining_tools.dm b/code/game/mecha/equipment/tools/mining_tools.dm
index 8d94ed2e15e..07231ed8854 100644
--- a/code/game/mecha/equipment/tools/mining_tools.dm
+++ b/code/game/mecha/equipment/tools/mining_tools.dm
@@ -118,12 +118,13 @@
var/obj/mecha/working/mecha = loc
if(!mecha.occupant)
return
+ var/mob/pilot = mecha.occupant
var/list/occupant = list()
- occupant |= mecha.occupant
- mecha.occupant.sight |= SEE_TURFS
+ occupant |= pilot
+ pilot.sight |= SEE_TURFS
scanning = 1
mineral_scan_pulse(occupant,get_turf(loc))
spawn(equip_cooldown)
scanning = 0
- mecha.occupant.sight -= SEE_TURFS
+ pilot.sight -= SEE_TURFS
diff --git a/code/game/turfs/simulated/floor/plating.dm b/code/game/turfs/simulated/floor/plating.dm
index 215a52c08bd..ab4bac63354 100644
--- a/code/game/turfs/simulated/floor/plating.dm
+++ b/code/game/turfs/simulated/floor/plating.dm
@@ -214,8 +214,9 @@
else if (istype(AM, /mob/living))
var/mob/living/L = AM
L.adjustFireLoss(20)
- L.adjust_fire_stacks(20)
- L.IgniteMob()
+ if(L) //mobs turning into object corpses could get deleted here.
+ L.adjust_fire_stacks(20)
+ L.IgniteMob()
/turf/simulated/floor/plating/lava/attackby(obj/item/C, mob/user, params) //Lava isn't a good foundation to build on
return
diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm
index ef2bf3b66e4..8f913f964f2 100644
--- a/code/modules/paperwork/paper.dm
+++ b/code/modules/paperwork/paper.dm
@@ -198,6 +198,7 @@
t = "[t]"
else // If it is a crayon, and he still tries to use these, make them empty!
+ var/obj/item/toy/crayon/C = P
t = replacetext(t, "\[*\]", "")
t = replacetext(t, "\[hr\]", "")
t = replacetext(t, "\[small\]", "")
@@ -205,7 +206,7 @@
t = replacetext(t, "\[list\]", "")
t = replacetext(t, "\[/list\]", "")
- t = "[t]"
+ t = "[t]"
// t = replacetext(t, "#", "") // Junk converted to nothing!