diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 530206d3b5e..aa3715525a6 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -390,8 +390,8 @@ // returns whether this light has power // true if area has power and lightswitch is on /obj/machinery/light/proc/has_power() - var/area/A = src.loc.loc - return A.lightswitch && (!A.requires_power || A.power_light) + var/area/A = get_area(src) + return A && A.lightswitch && (!A.requires_power || A.power_light) /obj/machinery/light/proc/flicker(var/amount = rand(10, 20)) if(flickering) return