diff --git a/code/modules/atmospherics/machinery/components/components_base.dm b/code/modules/atmospherics/machinery/components/components_base.dm index 74bbfca0bdf..23babb68c96 100644 --- a/code/modules/atmospherics/machinery/components/components_base.dm +++ b/code/modules/atmospherics/machinery/components/components_base.dm @@ -71,7 +71,7 @@ underlays.Cut() color = null - var/uncovered_turf = HAS_TRAIT(loc, TRAIT_UNCOVERED_TURF) + var/uncovered_turf = loc && HAS_TRAIT(loc, TRAIT_UNCOVERED_TURF) SET_PLANE_IMPLICIT(src, (underfloor_state == UNDERFLOOR_INTERACTABLE && !uncovered_turf) ? GAME_PLANE : FLOOR_PLANE) // Layer is handled in update_layer() @@ -112,7 +112,7 @@ /obj/machinery/atmospherics/components/get_pipe_image(iconfile, iconstate, direction, color, piping_layer, trinary) var/mutable_appearance/pipe_appearance = ..() - if (underfloor_state == UNDERFLOOR_VISIBLE || HAS_TRAIT(loc, TRAIT_UNCOVERED_TURF)) + if (underfloor_state == UNDERFLOOR_VISIBLE || (loc && HAS_TRAIT(loc, TRAIT_UNCOVERED_TURF))) pipe_appearance.layer = BELOW_CATWALK_LAYER + get_pipe_layer_offset() SET_PLANE_EXPLICIT(pipe_appearance, FLOOR_PLANE, src) return pipe_appearance