diff --git a/code/__HELPERS/lists.dm b/code/__HELPERS/lists.dm index 501a6d8c473..620bd33d2b3 100644 --- a/code/__HELPERS/lists.dm +++ b/code/__HELPERS/lists.dm @@ -307,6 +307,6 @@ proc/listclearnulls(list/list) return r /proc/safe_pick_list(var/list/L) - if(L.len) + if(L && L.len) return pick(L) return null \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 49b15937d9c..14693cbd66f 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -529,7 +529,7 @@ if(iscarbon(AM)) var/mob/living/carbon/C = AM - if(C.l_hand.w_class <= 2 || C.r_hand.w_class <= 2) + if((C.l_hand && C.l_hand.w_class <= 2) || (C.r_hand && C.r_hand.w_class <= 2)) return C return null @@ -558,7 +558,7 @@ if(iscarbon(AM)) var/mob/living/carbon/C = AM - if(C.l_hand.w_class <= 2 || C.r_hand.w_class <= 2) + if(C.l_hand && C.l_hand.w_class <= 2 || C.r_hand && C.r_hand.w_class <= 2) return C return null @@ -609,10 +609,10 @@ var/obj/item/stolen_item = null for(var/mob/living/carbon/C in view(1,src)) - if(C.l_hand.w_class <= 2) + if(C.l_hand && C.l_hand.w_class <= 2) stolen_item = C.l_hand - if(C.r_hand.w_class <= 2) + if(C.r_hand && C.r_hand.w_class <= 2) stolen_item = C.r_hand if(stolen_item)