From 8ce12e78385f55de606f5bb8249357706b7cdd67 Mon Sep 17 00:00:00 2001
From: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>
Date: Thu, 6 Jun 2024 17:28:44 -0400
Subject: [PATCH] add null check (#25834)
---
code/modules/reagents/reagent_containers/hypospray.dm | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/code/modules/reagents/reagent_containers/hypospray.dm b/code/modules/reagents/reagent_containers/hypospray.dm
index 7a410f66420..2aafcf11eed 100644
--- a/code/modules/reagents/reagent_containers/hypospray.dm
+++ b/code/modules/reagents/reagent_containers/hypospray.dm
@@ -36,9 +36,10 @@
return
var/mob/living/carbon/human/H = M
- if(HAS_TRAIT(H.wear_suit, TRAIT_HYPOSPRAY_IMMUNE) && !ignore_hypospray_immunity) // This check is here entirely to stop goobers injecting nukies with meme chems
- to_chat(user, "[src] is unable to penetrate the armour of [M] or interface with any injection ports.")
- return
+ if(H.wear_suit)
+ if(HAS_TRAIT(H.wear_suit, TRAIT_HYPOSPRAY_IMMUNE) && !ignore_hypospray_immunity) // This check is here entirely to stop goobers injecting nukies with meme chems
+ to_chat(user, "[src] is unable to penetrate the armour of [M] or interface with any injection ports.")
+ return
if(reagents.total_volume && (can_pierce_hardsuits || M.can_inject(user, TRUE))) // can_pierce_hardsuits should be checked first or there will be an error message.
to_chat(M, "You feel a tiny prick!")